android 旋转动画一直转,不卡顿
16lz
2021-01-26
一直转的旋转动画中间有停顿的只要原因是,旋转动画的旋转速度不是一直不变的,是有加速过程的,所以解决这个问题就可以让旋转动画一直转,不停顿:
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);
更多相关文章
- Android(安卓)View体系(三)--实现 View 的滑动七种方式
- Android(安卓)OpenGL自学笔记
- Android之旋转button视图
- Android(安卓)属性动画 实现view翻转 旋转 平移 拉伸 透明度 背
- Android中一个动画应用于两个View中不同步的问题
- Android(安卓)5.1 Lollipop Phone工作流程浅析(十三)__InCallAct
- API Demos 2.2 研读笔记(10)——Redirection, Reorder Activity an
- (4.1.23.1)Android(安卓)属性动画(Property Animation) 完全解析 (上)
- Android实现图片单点旋转缩放保存-仿百度魔图