您当前的位置: 首页 >  动画

蓝不蓝编程

暂无认证

  • 0浏览

    0关注

    706博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

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

蓝不蓝编程 发布时间:2019-08-30 09:48:37 ,浏览量:0

完整代码
    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.interpolator = LinearInterpolator()
        animation.duration = animateTime
        srcView.startAnimation(animation)
    }
关键代码
        //设置无线循环
        animation.repeatCount = Animation.INFINITE
        //设置匀速旋转
        animation.interpolator = LinearInterpolator()
关于我

厦门大学计算机专业 | 前华为工程师 分享编程技术,没啥深度,但看得懂,适合初学者。 Java | 安卓 | 前端 | 小程序 | 鸿蒙 公众号:花生皮编程 ​​​​​​​

关注
打赏
1639405877
查看更多评论
立即登录/注册

微信扫码登录

0.0428s