Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想知道是否有办法在 AnimationDrawable 重复 X 次(比如说 3 次)后停止 AnimationDrawable,就像 Animation 对象一样。
问候,
是的,你应该使用
动画监听器
并覆盖 onAnimationRepeat
>
public void onAnimationRepeat(Animation animation) { if (counter == 3) { // break } // else go on }
if (x==3){parentView.clearAnimation();}
parentView 是将动画应用到的视图。