如何在较旧的Android版本中使用Fragments和objectAnimator?

时间:2012-12-10 03:19:28

标签: android android-fragments objectanimator

我尝试使用片段和objectAnimator来制作像here这样的翻转动画,并且在Android 4.1上一切正常,但是当我尝试添加android-support-v13. jar时,请使用FragmentActivity并在旧版本上启动它版本,片段之间的动画使应用程序崩溃时出现此错误:

java.lang.RuntimeException: Unknown animation name: objectAnimator

拜托,您能告诉我如何使用objectAnimator或如何使用常见的Android动画创建翻转动画吗?

UPD:我也尝试使用http://nineoldandroids.com/,但我无法理解它如何用于活动过渡动画。

1 个答案:

答案 0 :(得分:0)

https://developer.android.com/guide/topics/graphics/prop-animation.html#declaring-xml

  

从Android 3.1开始,您应该保存属性的XML文件   res / animator /目录中的动画(而不是res / anim /)。