动画初步

   

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类似;
 

转载于:https://www.cnblogs.com/montahan/p/4236280.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值