在 ImageView 中延迟清除动画

clear animation with delay in ImageView

我的代码中有一个动画。但是我想当我单击 Button 时,我的 ImageView return 到原始位置(重置动画)我有一个方法。我的代码是:

 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.setDuration((长) 2*1000);

不工作!!!

android android-动画

这是你要表演的动画?

new RotateAnimation(0.0f, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f);

好像所有度数都是0.0f.