我想在視圖上運行多個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方法,它會發出異常。 –
是的。我已經。 –