美文网首页
android ViewPropertyAnimator

android ViewPropertyAnimator

作者: reedthinking | 来源:发表于2017-07-01 23:20 被阅读0次

ViewPropertyAnimator的基础使用

inner class ShiningTask(var view: View) : Runnable {
        override fun run() {
            //设置闪烁效果
            val alpha = if (view.alpha == 0f) 1f else 0f
            //设置透明度动画,时长1秒
            view.animate().alpha(alpha).duration = 1000
            //设置时间比duration稍长使得新的alpha不会cancel上一个animation
            mHandler.postDelayed(this, 1100)
        }
    }

相关文章

网友评论

      本文标题:android ViewPropertyAnimator

      本文链接:https://www.haomeiwen.com/subject/brogcxtx.html