如何降低Android中RotateAnimation的速度

3
我该如何降低 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的持续时间增加。 - Sherif elKhatib
2个回答

8

将其持续时间增加,因为速度=距离/时间

rotateAnimation.setDuration(30000);

谢谢。我以为setDuration()是给旋转时间的。 - AnujAroshA

1

只需增加动画的持续时间。 持续时间是执行动画的时间,因此如果您增加持续时间,动画将需要更多时间才能完成,换句话说-动画的速度将减慢。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接