动画类型
Android的animation由四种类型组成
XML中
JavaCode中
Android动画模式
Animation主要有两种动画模式:
一种是tweened animation(渐变动画)
一种是frame by frame(画面转换动画)
translate.xml 移动效果:
Android的animation由四种类型组成
XML中
alpha | 渐变透明度动画效果 |
scale | 渐变尺寸伸缩动画效果 |
translate | 画面转换位置移动动画效果 |
rotate | 画面转移旋转动画效果 |
JavaCode中
AlphaAnimation | 渐变透明度动画效果 |
ScaleAnimation | 渐变尺寸伸缩动画效果 |
TranslateAnimation | 画面转换位置移动动画效果 |
RotateAnimation | 画面转移旋转动画效果 |
Android动画模式
Animation主要有两种动画模式:
一种是tweened animation(渐变动画)
XML中 | JavaCode |
alpha | AlphaAnimation |
scale | ScaleAnimation |
一种是frame by frame(画面转换动画)
XML中 | JavaCode |
translate | TranslateAnimation |
rotate | RotateAnimation |
Android动画解析
alpha xml 淡出效果
alpha xml 淡入效果
rotate.xml 旋转效果:
项目中
<?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <item> <rotate android:fromDegrees="0" android:interpolator="@android:anim/linear_interpolator" android:pivotX="50%" android:pivotY="50%" android:toDegrees="360" > <bitmap android:antialias="true" android:filter="true" android:src="@mipmap/ic_loading" /> </rotate> </item> </layer-list>
scale.xml 缩放效果:
translate.xml 移动效果: