[英]AnimationSet for Views
我知道可以使用animationset同時運行一系列動畫:
AnimationSet animationSet = new AnimationSet(true);
animationSet.addAnimation(new RotateAnimation(this,0));
/**
* more animation
*/
animationSet.addAnimation(new RotateAnimation(this,90));
animationSet.start();
我想用viewanimator(同時經過動畫處理的一系列視圖)實現類似的功能:
ViewPropertyAnimator a = v.animate().rotation(0).setDuration(500);
有沒有辦法可以做到這一點?
如果只對View對象的一個或兩個屬性進行動畫處理,則可以使用ObjectAnimator;但是如果同時對多個屬性進行動畫處理,或者如果您只想使用更方便的語法為特定屬性設置動畫,則ViewPropertyAnimator可能會更好-適合任務。
view.animate().scaleX(2).scaleY(4).rotation(180).
setDuration(3000).setInterpolator(new
AccelerateDecelerateInterpolator()).start();
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.