【问题标题】:How to use Fragments and objectAnimator in older Android versions?如何在旧版 Android 中使用 Fragments 和 objectAnimator?
【发布时间】:2012-12-10 03:19:28
【问题描述】:

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

java.lang.RuntimeException: Unknown animation name: objectAnimator

请问,你能告诉我如何使用 objectAnimator 或如何使用常见的 Android 动画创建翻转动画吗?

UPD:我也尝试使用http://nineoldandroids.com/,但我不明白它如何用于活动过渡动画。

【问题讨论】:

标签: android android-fragments objectanimator


【解决方案1】:

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

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

【讨论】:

    猜你喜欢
    • 2012-07-01
    • 1970-01-01
    • 2013-12-20
    • 1970-01-01
    • 1970-01-01
    • 2017-08-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多