我尝试旋转的ImageView与animation.i写了一些代码。此是我的XML动画代码旋转动画
<rotate
xmlns:android="http://schemas.android.com/apk/res/android"
android:fromDegrees="0"
android:toDegrees="360"
android:pivotX="50%"
android:pivotY="50%"
android:repeatCount="infinite" />
,这是一个java代码
final ImageView myImage = (ImageView)findViewById(R.id.rot);
final Animation myRotation = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.rotator);
myImage.setAnimation(myRotation);
Handler ha=new Handler();
ha.postDelayed(new Runnable() {
@Override
public void run() {
myRotation.setDuration(1000);
}
}, 1000);
myRotation.cancel();
我尝试取消动画持续时间结束,但我可以旋转ImageView,但我无法取消动画 我该如何解决我的问题?如果有人知道的解决方案,请帮助我
更改它的重复次数。 – savepopulation 2014-09-29 13:48:10