【发布时间】:2013-04-10 09:58:21
【问题描述】:
我正在为 ICS 及更高版本 (4.0+) 的 Android 版本开发应用程序。在我的应用程序中,我使用动画来为目标对象的属性设置动画(使用 ObjectAnimator),这是一个代码 sn-p:
Animator disappearingAnimation = ObjectAnimator.ofFloat(regularScreenLayout, "alpha", 1f, 0f);
AnimatorSet appearingAnimations = new AnimatorSet();
Animator appearingAnimationAlpha = ObjectAnimator.ofFloat(statisticsScreenLayout, "alpha", 0f, 1f);
Animator appearingAnimationTranslate = ObjectAnimator.ofFloat(statistics_wrapper, "y",
changingContent.getHeight(), 0);
appearingAnimations.playTogether(appearingAnimationTranslate, appearingAnimationAlpha);
AnimatorSet animations = new AnimatorSet();
animations.setDuration(ANIMATION_TIME);
animations.playTogether(disappearingAnimation, appearingAnimations);
animations.start();
我所有的动画在所有版本的 ICS 上都能完美运行,但在装有 Jelly Bean 的设备上它们开始表现得很奇怪。例如,如果我想通过消失的动画更改某些视图的可见性,则视图只会在没有动画的情况下出现/消失(动画不起作用!)。有人遇到过这种问题,或者知道可能是什么原因以及如何解决,我将不胜感激。分享你的经验。谢谢
【问题讨论】:
标签: android animation android-4.2-jelly-bean