22

我正在尝试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>
4

2 回答 2

40

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

于 2015-09-06T19:58:58.953 回答
36

您是否创建了res/transition/explode.xml包含以下内容的文件?

<transitionSet xmlns:android="http://schemas.android.com/apk/res/android">
    <explode />
</transitionSet>
于 2015-01-28T03:12:50.877 回答