Android ImageView上的多次旋转
我想将ImageView旋转两次 最初它会旋转360度,然后再多旋转一些度 我正在使用以下代码Android ImageView上的多次旋转,android,rotation,android-imageview,android-ui,Android,Rotation,Android Imageview,Android Ui,我想将ImageView旋转两次 最初它会旋转360度,然后再多旋转一些度 我正在使用以下代码 protected void rotation(int start, int end, int time) { Animation a = new RotateAnimation((float)start, (float)end, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,0.5f);
protected void rotation(int start, int end, int time) {
Animation a = new RotateAnimation((float)start, (float)end,
Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,0.5f);
a.setDuration((long)time);
a.setInterpolator(new LinearInterpolator());
a.setFillAfter(true);
ImageView.startAnimation(a);
}
我的问题是
我调用这个函数两次,这样它就不会等待第一次,而是直接开始第二次旋转
我想等到第一次旋转完成,然后开始第二次旋转在第一个动画中设置侦听器
a.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
callNewAnimation();
}
@Override
public void onAnimationRepeat(Animation animation) {
}
});