码迷,mamicode.com
首页 > 其他好文 > 详细

动画初步

时间:2015-01-20 17:26:57      阅读:168      评论:0      收藏:0      [点我收藏+]

标签:

   

Tween动画有四个主要的实现,下面分别说明下:

AlphaAnimation:渐变动画 主要控制透明度变化动画类
ScaleAnimation:主要控制尺度变化的动画类
TranslateAnimation:主要控制位置变换的动画实现类
RotateAnimation:主要控制旋转的动画实现类
 
 
1、AlphaAnimation:渐变动画,主要控制透明度变化动画类,常使用AlphaAnimation(float fromAlpha, float toAlpha)来构造;
    fromAlpha:动画开始时的透明度(取值范围为0.0到1.0);
    toAlpha:动画结束时的透明度;
2、ScaleAnimation:主要控制尺度变化的动画类,常使用ScaleAnimation(float fromX, float toX, float fromY, float toY, int pivotXType, float pivotXValue, int pivotYType, float pivotYValue)来构造;
    fromX:动画开始X坐标上的伸缩尺度;
    toX:动画结束X坐标上的伸缩尺度;
    fromY:动画开始Y坐标上的伸缩尺度;
    toY:动画结束Y坐标上的伸缩尺度;
    pivotXType:X坐标上的伸缩模式,取值有:Animation.ABSOLUTE, Animation.RELATIVE_TO_SELF, Animation.RELATIVE_TO_PARENT;
    pivotXValue:X坐标上的伸缩值;
    pivotYType:Y坐标上的伸缩模式,取值有:Animation.ABSOLUTE, Animation.RELATIVE_TO_SELF, Animation.RELATIVE_TO_PARENT;
    pivotYValue:Y坐标上的伸缩值;
3、TranslateAnimation:主要控制位置变换的动画实现类,常使用TranslateAnimation(float fromXDelta, float toXDelta, float fromYDelta, float toYDelta)来构造;
    fromXDelta:动画开始的X坐标;
    toXDelta:动画结束的X坐标;
    fromYDelta:动画开始的Y坐标;
    toYDelta:动画结束的Y坐标;
4、RotateAnimation:主要控制旋转的动画实现类,常使用RotateAnimation(float fromDegrees, float toDegrees, int pivotXType, float pivotXValue, int pivotYType, float pivotYValue)来构造;
    fromDegrees:旋转开始角度;
    toDegrees:旋转结束角度;
    pivotXType, pivotXValue, pivotYType, pivotYValue与尺度变化动画ScaleAnimation类似;
 

动画初步

标签:

原文地址:http://www.cnblogs.com/montahan/p/4236280.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!