一直轉的旋轉動畫中間有停頓的只要原因是,旋轉動畫的旋轉速度不是一直不變的,是有加速過程的,所以解決這個問題就可以讓旋轉動畫一直轉,不停頓:
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);