注册 | 登录

How to use Fragments and objectAnimator in older Android versions?

itPublisher 分享于



推荐:Fragments In Android Studio

原英文链接:Fragments in Android Studio 这篇指南将会教你在Android Studio上简单地创建和使用Fragment,并在fragment里添加一个按钮,点击按钮会发送一个个动

I tried to use fragments and objectAnimator to make flip animation like here, and everything was ok on Android 4.1, but when I'm trying to add android-support-v13. jar, use FragmentActivity and launch it on older version, animation between fragments crashes the app with this error:

java.lang.RuntimeException: Unknown animation name: objectAnimator

Please, can you say me how to use objectAnimator or how to create flip animation using common Android animation?

UPD: I also tried to use, but I can't understand how it can be used for activity transition animation.

android android-fragments objectanimator
  this question
edited Dec 10 '12 at 3:36 asked Dec 10 '12 at 3:19 uncle Lem 1,864 6 21 47      check out this… are saying android.R.animator are broken while using with animatorsetCustomAnimation. –  anshul Apr 1 '13 at 10:45


1 Answers

推荐:Android UI(2)Getting Started - Supporting Devices and Fragments

Android UI(2)Getting Started - Supporting Devices and Fragments 3. Supporting Different Devices Supporting Different Languages Keep the UI String to e

Starting with Android 3.1, you should save the XML files for property animations in the res/animator/ directory (instead of res/anim/).

  this answer
answered Oct 5 '15 at 9:09 Gintama 682 8 16


推荐:Android Fragment avoid non-default constructors in fragments use a default constructor plus fragment

一、出现情况。 新建Fragment并自定义构造函数传递参数的时候。 二、出现原因。 当Fragment被销毁,在重建的时候,系统只会调用默认的无参构造函数,这样我们自








您的注册邮箱: 修改

重新发送激活邮件 进入我的邮箱