我正在研究一个RotateAnimation
。我开始旋转图像,但我想知道动画何时完成。我如何知道动画何时结束?
下面是我的旋转图像代码。
RotateAnimation rotateanimation = new RotateAnimation(StartPoint,
EndPoint, Animation.RELATIVE_TO_SELF, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f);
rotateanimation.setDuration(1000);
rotateanimation.setRepeatCount(0);
rotateanimation.setRepeatMode(Animation.REVERSE);
rotateanimation.setFillAfter(true);
rotateImage.setAnimation(rotateanimation);
rotateanimation.start();
relative.invalidate();
Use Animation Listener as:
implements animation listener in activity
and then :
*rotateanimation.setAnimationListener(MainActivity.this);
*after that you will find on
public void onAnimationEnd(Animation animation)
{
//Toast here on animation ends
}
http://developer.android.com/reference/android/view/animation/Animation.AnimationListener.html
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)