android AnimationSet
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中有一些设定,如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 属性为动画结束时透明度
更多相关文章
- 介绍两个Android开源项目:Android显示GIF动画
- Android:自定义view实现动画
- android 属性动画
- Android(安卓)揭露效果兼容低版本
- Android(安卓)7.0 如何去掉灭屏动画
- 强制系统横屏竖屏
- Android(安卓)RecyclerView
- android style 退出动画 解决退出动画无效问题
- android studio连接adb,远程调试