一直转的旋转动画中间有停顿的只要原因是,旋转动画的旋转速度不是一直不变的,是有加速过程的,所以解决这个问题就可以让旋转动画一直转,不停顿:
rotateAnimation = new RotateAnimation(0,360,Animation.RELATIVE_TO_SELF,0.5f,Animation.RELATIVE_TO_SELF,0.5f);
rotateAnimation.setDuration(300);
rotateAnimation.setFillAfter(true);
rotateAnimation.setRepeatMode(Animation.RESTART);
//让旋转动画一直转,不停顿的重点
rotateAnimation.setInterpolator(new LinearInterpolator());
rotateAnimation.setRepeatCount(-1);