我的代码中有一个动画。但是我想要单击按钮时的imageview返回原始位置(重置动画(我有一种方法。我的代码是:
private void returnToOriginalRotationState() {
RotateAnimation animation = new RotateAnimation(0.0f, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f);
animation.setInterpolator(new LinearInterpolator());
animation.setDuration((long) 2*1000);
animation.setFillAfter(true);
animation.setFillEnabled(true);
imgHeade.startAnimation(animation);
}
它也有效
但
animation.setDuration((long) 2*1000);
不工作!
尝试清晰的动画:
imgHeade.clearAnimation();