当前位置: 移动技术网 > IT编程>移动开发>Android > android---动画入门(一)

android---动画入门(一)

2019年02月22日  | 移动技术网IT编程  | 我要评论

卧尔康,破坏罗特斯的卵,最新bt下载

android 动画分为两类,view animation(视图动画)和property animation(属性动画),view animation(视图动画)包含了tween animation和frame animation, property animation包含value animation和objectanimation.

  1. view animation(视图动画)
    1. tween animation
    2. frame animation
  2. property animation(属性动画)
    1. value animation
    2. objectanimation

animation类是所有动画(scale,alpha,translate,rotate)的基类,所有派生自animation的类都具有它的一些公用属性

  1. android:duration : 一次动画的时间
  2. android:fillbefore:动画结束是否恢复到开始前的状态,true 是
  3. android:fillaftre:动画结束是否保持结束时的状态,true 是
  4. android:fillenable: 同 android:fillbefore
  5. android:repeatcount: 动画执行次数,(在set标签下无效,要设置到具体动画中)
  6. android:repeatmode:动画重复执行的模式:reverse 倒序回放,restart重新播放
  7. android:interpolator: 设置插值器

tween animation(补间动画)

  1. alpha   透明度渐变
  2. scale   放缩
  3. translate   移动
  4. rotate   旋转
  5. set   自定义组合动画

动画的调用方式有两种,xml标签实现和代码实现

(一):标签

利用xml来定义标签,xml文件保存再res/anim或者res/drawable下

(二):代码

 

 

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网