在Android中的playTogether AnimatorSet中为sequantial AnimatorSet设置动画

时间:2016-04-19 00:59:50

标签: android animation android-animation

我正在尝试使用AnimatorSets链接一组动画。

我有这样的事情:

AnimatorSet sequentialSet = new AnimatorSet();
sequentialSet.playSequentially(animOne, animTwo, animThree);

AnimatorSet togetherSet = new AnimatorSet();
togetherSet.playTogether(sequentialSet, animFour, animFive);
togetherSet.setDuration(ANIM_TIMEOUT);
togetherSet.start();

然而,发生的事情是,animOne与animFour和animFive一起动画,然后动画动画animTwo然后动画3发生。有没有人见过这个,有没有办法制作动画animOne,animTwo,animThree在animFour和animFive的同时执行?

感谢您的帮助。

1 个答案:

答案 0 :(得分:2)

问题是togetherSet.setDuration(ANIM_TIMEOUT)覆盖了其中所有动画的持续时间。我的解决方案是为每个动画单独设置持续时间,而不是在设置本身上设置它。

相关问题