2017-04-24 10 views
1

私のコードにアニメーションがあります。 ボタンをクリックすると画像が元の場所に戻る(アニメーションをリセットする) 私はそのための方法があります。 私のコードは次のとおりです。

ImageView clear animation

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); 


同様 に動作します!!!

答えて

1

明確なアニメーションのためにこれを試してみてください。

imgHeade.clearAnimation(); 
+0

おかげで、私は遅れてアニメーションをクリアしたいです –