我有一个ImageView,我在它上面应用了旋转动画。由于我想让旋转持续进行,所以我在rotate.xml中将repeatCount设置为无限:
android:repeatCount="infinite"
在onCreate()方法中,我加载动画并启动它。
Animation myAnim = AnimationUtils.loadAnimation(this, R.anim.rotate);
objectImg.startAnimation(myAnim);
当按下按钮时,旋转必须停止。因此在我的onClick()中,我调用了clearAnimation()。objectImg.startAnimation(myAnim);
我的简单问题是停止动画是否正确。我假设clearAnimation()对应于loadAnimation(),但并没有stopAnimation()对应于startAnimation()。