Android 动画分为两种,一种为View Animation,称为视图动画。另一种为Property Animator,称之为属性动画。
- View Animation(视图动画)包括:Tween Animation(补间动画)、Frame Animation(逐帧动画)
- Property Animator(属性动画)包括:ValueAnimator(定值动画)、ObjectAnimation(对象动画)
注意:
- View Animation主要用来实现动画(Frame Animation)、控件的渐入渐出移动旋转和缩放(Tween Animation),只能对派生自View的控件实例起作用;Property Animator主要用来针对控件的某一个属性来做动画,能单独改变控件的某一个属性的值,比如颜色;
- View Animation是API Level 1就引入的。Property Animation是API Level 11引入的,即Android 3.0才开始有Property Animation相关的API。
- View Animation虽能对控件做动画,但并没有改变控件内部的属性值(Tween Animation中的TranslateAnimation)。而Property Animator则是恰恰相反,Property Animator是通过改变控件内部的属性值来达到动画效果的。
备注:
本文为阅读部分博客、书籍知识的个人笔记,不算原创文章,只做记录方便复习。