1

如何降低RotateAnimation实例的旋转速度。我使用下面的代码片段来做动画。如何降低Android中RotateAnimation的速度

rotateAnimation = new RotateAnimation(currentRotation, currentRotation + (360 * 5), Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); 
currentRotation = (currentRotation + (360 * 5)); 
rotateAnimation.setDuration(10000); 
rotateAnimation.setInterpolator(new LinearInterpolator()); 
rotateAnimation.setRepeatCount(Animation.INFINITE); 
rotateAnimation.setRepeatMode(Animation.INFINITE); 
rotateAnimation.setFillEnabled(true); 
rotateAnimation.setFillAfter(true); 
rotateAnimation.setAnimationListener(animationInListener); 
recordRingImageView.startAnimation(rotateAnimation); 
+2

**降低转速=增加持续时间**。因此,增加10000个持续时间。 –

回答

5

增加它的持续时间,因为速度=距离/时间

rotateAnimation.setDuration(30000); 
+0

谢谢。我认为setDuration()给出了旋转的时间。 – AnujAroshA

1

只需增加动画的持续时间。 持续时间是执行动画的时间,所以如果增加持续时间,动画将需要更多时间才能完成,换句话说,动画的速度会降低。