首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在安卓系统中降低RotateAnimation的速度

如何在安卓系统中降低RotateAnimation的速度
EN

Stack Overflow用户
提问于 2013-10-29 13:13:46
回答 2查看 3.7K关注 0票数 3

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

代码语言:javascript
复制
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);
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2013-10-29 13:16:25

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

代码语言:javascript
复制
rotateAnimation.setDuration(30000);
票数 8
EN

Stack Overflow用户

发布于 2013-10-29 13:16:16

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

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/19659250

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档