AnimationSet: Representsa group of Animations that should be played together. The transformation ofeach individual animation are composed together into a single transform. IfAnimationSet sets any properties that its children also set (for example, durationor fillBefore), the values of AnimationSet override the child values.

在Android 中用于制作混合型动画

AnimationSet.setInterpolator:Sets the acceleration curve for this animation. Defaults to a linearinterpolation.

AnimationSet.setRepeatMode():efineswhat this animation should do when it reaches the end. This setting is appliedonly when the repeat count is either greater than 0 orINFINITE. DefaultstoRESTART.

AnimationSet 可以包含多个Animation,但都是在同一个时间执行的,是并行,不是串行执行的。
如果AnimationSet中有一些设定,如duration,fillBefore等,它包含的子动作也设定了的话,

子动作中的设定将会给覆盖掉。

旋转动画

<rotateandroid:fromDegrees="-2"         android:toDegrees="+2"                 android:pivotX="50%"         android:pivotY="50%"                 android:duration="1000"android:repeatCount="infinite"android:repeatMode="reverse"/> 

android:pivotX="50%" 表示旋转点相对于整个控件的水平坐标。

android:pivotY="50%" 表示旋转点相对于整个控件的垂直坐标。

android:fromDegrees 表示从相对于竖直位置的偏移值处开始旋转。

android:toDegrees表示旋转到相对于竖直位置的偏移值处。

android:duration表示动画持续的时间

android:repeatCount表示动画重复的次数

android:repeatMode 表示动画重复模式

透明度动画

<alpha android:fromAlpha="1.0" android:toAlpha="0.2" android:duration="2000"android:repeatMode="reverse"android:repeatCount="infinite" />

fromAlpha 属性为动画起始时透明度

toAlpha 属性为动画结束时透明度



更多相关文章

  1. 介绍两个Android开源项目:Android显示GIF动画
  2. Android:自定义view实现动画
  3. android 属性动画
  4. Android(安卓)揭露效果兼容低版本
  5. Android(安卓)7.0 如何去掉灭屏动画
  6. 强制系统横屏竖屏
  7. Android(安卓)RecyclerView
  8. android style 退出动画 解决退出动画无效问题
  9. android studio连接adb,远程调试

随机推荐

  1. Gitlab备份和恢复操作记录
  2. 云计算基础知识汇总
  3. IT牛人进阶的必经之路
  4. Java项目发布之基础知识准备
  5. Linux Centos7安装 jdk
  6. Mongodb笔记之(Java中操作Mongodb)
  7. Oracle建立表空间和用户
  8. spring cloud准备linux常用命令
  9. CDH5 完美手动配置过程改进版
  10. 同样是爬天气,凭什么他能撩到妹?!