我想在视图上运行多个AnimatorSet。 AnimatorSet应该连续运行。我想在不使用时间延迟处理程序的情况下执行此操作。我该怎么做?如何连续启动AnimatorSet?
2
A
回答
2
在您的代码中试试这个。
AnimatorSet bouncer = new AnimatorSet();
ObjectAnimator anim = ObjectAnimator.ofFloat(mTextView, "rotationX", 0f, 180f);
anim.setDuration(2000);
ObjectAnimator anim2 = ObjectAnimator.ofFloat(mTextView, "rotationX", 180f, 0f);
anim2.setDuration(2000);
ObjectAnimator anim3 = ObjectAnimator.ofFloat(mTextView, "rotationY", 0f, 180f);
anim3.setDuration(2000);
ObjectAnimator anim4 = ObjectAnimator.ofFloat(mTextView, "rotationY", 180f, 0f);
anim4.setDuration(2000);
bouncer.playSequentially(anim, anim2, anim3, anim4);
bouncer.start();
注
方法:
播放(动画阿尼姆);
play (Animator anim): // add an animation and return AnimatorSet.Builder
playSequentially(List items);
playSequentially (List items): // add a set of animations, play sequentially, and play them one by one
playSequentially(Animator ... Items);
playSequentially (Animator... Items): // add a set of animations, play sequentially, and play them one by one
playTogether(Collection items);
playTogether (Collection items): // add a set of animations, played sequentially, and played together
playTogether(Animator ... Items);
playTogether (Animator... Items): // add a set of animations, play sequentially, and play together
相关问题
- 1. Android AnimatorSet动画+ setStartDelay VS AnimatorListenener.onAnimationStart?
- 2. Loop AnimatorSet
- 3. 连续两次启动cmd.exe问题
- 4. 连续启动多个任务
- 5. 启动Abaqus的连续计算
- 6. 如何在AnimatorSet的动画停止后立即执行动作?
- 7. 如何启动延续任务实例?
- 8. 连续动画
- 9. 如何重置/重新启动动画并使它看起来连续?
- 10. 如何使用JScrollPane连续滚动
- 11. 我该如何连续移动视图?
- 12. 如何制作连续翻转动画?
- 13. 如何写onclick连续动画图片?
- 14. 如何在android中做连续动画?
- 15. 如何连续使用jQuery动画?
- 16. 如何在AnimatorSet中的动画之间添加延迟playSequentially()?
- 17. 如何使用xml中定义的动画加载AnimatorSet
- 18. 检查AnimatorSet是否已完成动画?
- 19. 实现使用AnimatorSet
- 20. AnimatorSet class return RuntimeException(“Stub!”)
- 21. 连续Web作业自动重新启动
- 22. jquery连续动画
- 23. 连续滑动div
- 24. FullPage.JS连续滚动
- 25. iphone连续动画
- 26. 伪连续滚动
- 27. TornadoFX连续动画?
- 28. WPF连续动画
- 29. Android连续移动动画
- 30. 连续自动滚动ListView
我试图用,但有那个漫画家集对象得到释放异常。 –
我有单独的类来创建和运行动画集。无论何时我需要创建或运行动画设置,我都会使用它的实例。如果我连续调用运行AnimatorSet方法,它会发出异常。 –
是的。我已经。 –