安卓属性动画设置无限循环播放

完整代码

    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

你可能感兴趣的:(安卓属性动画设置无限循环播放)