Android果冻豆动画奇怪的行为

Android果冻豆动画奇怪的行为,android,animation,android-4.2-jelly-bean,Android,Animation,Android 4.2 Jelly Bean,我正在开发一款应用程序,适用于ICS及以上版本的Android(4.0+)。在我的应用程序中,我正在使用动画(使用ObjectAnimator)为目标对象的属性设置动画,下面是一段代码片段: Animator disappearingAnimation = ObjectAnimator.ofFloat(regularScreenLayout, "alpha", 1f, 0f); AnimatorSet appearingAnimations = new AnimatorSet(

我正在开发一款应用程序,适用于ICS及以上版本的Android(4.0+)。在我的应用程序中,我正在使用动画(使用ObjectAnimator)为目标对象的属性设置动画,下面是一段代码片段:

    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上都工作得很好,但在有果冻豆的设备上,它们开始表现得很奇怪。例如,如果我想用正在消失的动画更改某个视图的可见性,则该视图只会在没有动画的情况下显示/消失(动画不起作用!)。如果有人有这样的问题,或者知道原因是什么以及如何解决,我将不胜感激。分享你的经验。Thx

虽然听起来很奇怪,但我通过将视图和属性动画结合起来解决了这个问题(正如您在我的代码片段中看到的,我只使用属性动画)。因此,更简单的动画,我使用视图动画(用xml定义)制作,而需要更改属性的动画,我使用新的属性动画制作。这解决了我的问题,现在所有的东西都在ICS和Jelly Bean设备上正常工作。希望这有帮助