活动转换错误,无法解析符号'@ transition / explode'

时间:2015-01-28 01:07:52

标签: android android-5.0-lollipop material-design activity-transition

我正在尝试Activity Transitions,当我在我的values-21 / styles.xml中粘贴下面的代码时,我收到错误:

  

无法解析符号'@ transition / explode'

<style name="BaseAppTheme" parent="android:Theme.Material">
  <!-- enable window content transitions -->
  <item name="android:windowContentTransitions">true</item>

  <!-- specify enter and exit transitions -->
  <item name="android:windowEnterTransition">@transition/explode</item>
  <item name="android:windowExitTransition">@transition/explode</item>

  <!-- specify shared element transitions -->
  <item name="android:windowSharedElementEnterTransition">
    @transition/change_image_transform</item>
  <item name="android:windowSharedElementExitTransition">
    @transition/change_image_transform</item>
</style>

2 个答案:

答案 0 :(得分:33)

最简单的答案 - 将其替换为@android:transition / explode

答案 1 :(得分:31)

您是否使用以下内容创建了res/transition/explode.xml文件?

<transitionSet xmlns:android="http://schemas.android.com/apk/res/android">
    <explode />
</transitionSet>