博客
关于我
255_属性动画解析
阅读量:145 次
发布时间:2019-02-28

本文共 770 字,大约阅读时间需要 2 分钟。

属性动画解析
主要就是用ObjectAnimator,
方法很简单,给一个View,然后给字符串参数,然后给值,给多少都行,非常方便
ObjectAnimator animator = ObjectAnimator.ofFloat(textview, "alpha", 1f, 0f, 1f).setDuration(3000).start();
ObjectAnimator animator = ObjectAnimator.ofFloat(textview, "rotation", 0f, 360f).setDuration(3000).start();
float curTranslationX = textview.getTranslationX();
ObjectAnimator animator = ObjectAnimator.ofFloat(textview, "translationX", curTranslationX, -500f, curTranslationX).setDuration(3000).start();  
ObjectAnimator animator = ObjectAnimator.ofFloat(textview, "scaleY", 1f, 3f, 1f).setDuration(3000).start();  
给的参数其实就是根据View的方法来的
setRotation()、getRotation()、setTranslationX()、getTranslationX()、setScaleY()、getScaleY()
给的就是rotation,translationX,scaleY
当然还有rotationX,rotaionY,translationY,scaleX等等

转载地址:http://obac.baihongyu.com/

你可能感兴趣的文章
MySQL与Informix数据库中的同义表创建:深入解析与比较
查看>>
mysql与mem_细说 MySQL 之 MEM_ROOT
查看>>
MySQL与Oracle的数据迁移注意事项,另附转换工具链接
查看>>
mysql丢失更新问题
查看>>
MySQL两千万数据优化&迁移
查看>>
MySql中 delimiter 详解
查看>>
MYSQL中 find_in_set() 函数用法详解
查看>>
MySQL中auto_increment有什么作用?(IT枫斗者)
查看>>
MySQL中B+Tree索引原理
查看>>
mysql中cast() 和convert()的用法讲解
查看>>
mysql中datetime与timestamp类型有什么区别
查看>>
MySQL中DQL语言的执行顺序
查看>>
mysql中floor函数的作用是什么?
查看>>
MySQL中group by 与 order by 一起使用排序问题
查看>>
mysql中having的用法
查看>>
MySQL中interactive_timeout和wait_timeout的区别
查看>>
mysql中int、bigint、smallint 和 tinyint的区别、char和varchar的区别详细介绍
查看>>
mysql中json_extract的使用方法
查看>>
mysql中json_extract的使用方法
查看>>
mysql中kill掉所有锁表的进程
查看>>