Animation动画效果中构造函数的用法及参数



  一. Alpha:淡入淡出。AlphaAnimation

        构造方法:
         1.AlphaAnimation aa = new AlphaAnimation(0.0f,1.0f);

             第一个参数:动画初始的透明度。

             第二个参数:动画结束的透明度
             1.0为最大值。0.0为最小值。都是float类型



   二. Scale:缩放。ScaleAnimation

        构造方法:

           1.ScaleAnimation(float fromX, float toX, float fromY, float toY,int pivotXType, float pivotXValue, int pivotYType, float pivotYValue) 

               float fromX 动画起始时 X坐标上的伸缩尺寸 0.0f~1.0f 
               float toX 动画结束时 X坐标上的伸缩尺寸  0.0f~1.0f
               float fromY 动画起始时Y坐标上的伸缩尺寸 0.0f~1.0f
               float toY 动画结束时Y坐标上的伸缩尺寸 0.0f~1.0f
               int pivotXType 动画在X轴相对于物件位置类型 Animation的固定值
               float pivotXValue 动画相对于物件的X坐标的开始位置 0.0f~1.0f
               int pivotYType 动画在Y轴相对于物件位置类型 Animation的固定值
               float pivotYValue 动画相对于物件的Y坐标的开始位置 0.0f~1.0f
             
             Animation的固定值:
                  Animation.RELATIVE_TO_SELF= 1.相对于自己。
                  Animation.RELATIVE_TO_PARENT = 2;相对于父类
                  
   三.Rotate:旋转。RotateAnimation
        构造方法:
          1.public RotateAnimation (float fromDegrees, float toDegrees, int pivotXType, float pivotXValue, int pivotYType, float pivotYValue)
           
            fromDegrees:旋转的开始角度。
            toDegrees:旋转的结束角度。
            pivotXType:X轴的伸缩模式,可以取值为ABSOLUTE、RELATIVE_TO_SELF、RELATIVE_TO_PARENT。
            pivotXValue:X坐标的伸缩值。
            pivotYType:Y轴的伸缩模式,可以取值为ABSOLUTE、RELATIVE_TO_SELF、RELATIVE_TO_PARENT。
            pivotYValue:Y坐标的伸缩值。


   四.Translate:移动。TranslateAnimation
        构造方法:
            1.TranslateAnimation(float fromXDelta, float toXDelta, float fromYDelta, float toYDelta)
            
            float fromXDelta:这个参数表示动画开始的点离当前View X坐标上的差值;
            float toXDelta, 这个参数表示动画结束的点离当前View X坐标上的差值;
            float fromYDelta, 这个参数表示动画开始的点离当前View Y坐标上的差值;
            float toYDelta)这个参数表示动画开始的点离当前View Y坐标上的差值;


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值