完整代码
private fun rotate(srcView: View) {
val animateTime = 5000L
val animation = RotateAnimation(0f, 360f,
Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f)
animation.fillAfter = true
animation.repeatCount = Animation.INFINITE
animation.duration = animateTime
animation.interpolator = LinearInterpolator()
srcView.startAnimation(animation)
}
关键代码
animation.repeatCount = Animation.INFINITE
网友评论