我想在視圖上運行多個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. 連續啓動多個任務
- 3. 如何在AnimatorSet的動畫停止後立即執行動作?
- 4. 如何啓動延續任務實例?
- 5. 如何使用JScrollPane連續滾動
- 6. 我該如何連續移動視圖?
- 7. 如何在android中做連續動畫?
- 8. 如何製作連續翻轉動畫?
- 9. 如何在AnimatorSet中的動畫之間添加延遲playSequentially()?
- 10. 如何使用xml中定義的動畫加載AnimatorSet
- 11. AnimatorSet class return RuntimeException(「Stub!」)
- 12. 實現使用AnimatorSet
- 13. iphone連續動畫
- 14. 連續滑動div
- 15. FullPage.JS連續滾動
- 16. 僞連續滾動
- 17. WPF連續動畫
- 18. 連續自動滾動ListView
- 19. 如何強制iPad啓動wifi連接?
- 20. 如何在PHP中啓動PGSQL連接?
- 21. 如何繼續連鎖?
- 22. X11:如何連續渲染
- 23. 如何連續運行getJSON
- 24. 如何'grep'連續流?
- 25. 啓用識別連續語音
- 26. PowerShell循環連續檢查服務器是否啓動
- 27. UIPanGestureRecognizer和重新啓用的UIScrollView之間的連續滾動
- 28. 1分鐘後不重新啓動連續語音識別
- 29. 在連續啓動時打開FBSession(SDK SDK 3.0)
- 30. Python使用Gtk開關啓動和停止連續功能
我試圖用,但有那個漫畫家集對象得到釋放異常。 –
我有單獨的類來創建和運行動畫集。無論何時我需要創建或運行動畫設置,我都會使用它的實例。如果我連續調用運行AnimatorSet方法,它會發出異常。 –
是的。我已經。 –