Android RotateAnimation无限旋转每圈结束停顿问题的解决方法

就是将 toDegrees 跟 duration 增大一万倍,那么大概转5小时才会停顿一下,相当于把很小的停顿弱化了一万倍,几乎可以忽略不计,很好的解决了这个问题,具体代码如下:

RotateAnimation rotateAnimation = new RotateAnimation(0,360,Animation.RELATIVE_TO_SELF,0.5f,Animation.RELATIVE_TO_SELF,0.5f);
rotateAnimation.setDuration(3000);
rotateAnimation.setRepeatCount(-1);
myImageView.startAnimation(rotateAnimation);
原创文章 81 获赞 48 访问量 3万+

猜你喜欢

转载自blog.csdn.net/qq_15181569/article/details/102970768