Android 笔记:View Animation(视图动画)与Property Animator(属性动画)

来源:互联网 发布:excel两列重复数据筛选 编辑:程序博客网 时间:2024/05/18 12:37

 

Android 动画分为两种,一种为View Animation称为视图动画。另一种为Property Animator,称之为属性动画。

  •   View Animation(视图动画)包括:Tween Animation(补间动画)、Frame Animation(逐帧动画)
  •   Property Animator(属性动画)包括:ValueAnimator(定值动画)、ObjectAnimation(对象动画)

  注意:

  1. View Animation主要用来实现动画(Frame Animation)、控件的渐入渐出移动旋转和缩放(Tween Animation),只能对派生自View的控件实例起作用;Property Animator主要用来针对控件的某一个属性来做动画,能单独改变控件的某一个属性的值,比如颜色;
  2. View Animation是API Level 1就引入的。Property Animation是API Level 11引入的,即Android 3.0才开始有Property Animation相关的API。
  3. View Animation虽能对控件做动画,但并没有改变控件内部的属性值(Tween Animation中的TranslateAnimation)。而Property Animator则是恰恰相反,Property Animator是通过改变控件内部的属性值来达到动画效果的。

备注:

  本文为阅读部分博客、书籍知识的个人笔记,不算原创文章,只做记录方便复习。

  参考文章:启舰的博客---Android自定义控件三部曲

0 0
原创粉丝点击