ScaleAnimation类是Android系统中的尺寸变化动画类,用于控制View对象的尺寸变化,该类继承于Animation类。ScaleAnimation类中的很多方法都与Animation类一致,该类中最常用的方法便是ScaleAnimation构造方法。

【基本语法】public 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轴的伸缩模式,可以取值为ABSOLUTE、RELATIVE_TO_SELF、RELATIVE_TO_PARENT。

pivotXValue:X坐标的伸缩值。

pivotYType:Y轴的伸缩模式,可以取值为ABSOLUTE、RELATIVE_TO_SELF、RELATIVE_TO_PARENT。

pivotYValue:Y坐标的伸缩值。

有三种默认值:

RELATIVE_TO_PARENT 相对于父控件

RELATIVE_TO_SELF 相对于符自己

RELATIVE_TO_ABSOLUTE 绝对坐标

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-05-28
  • 2022-01-21
  • 2022-12-23
  • 2021-10-01
  • 2021-07-07
猜你喜欢
  • 2021-12-31
  • 2022-02-16
  • 2022-12-23
  • 2021-06-12
相关资源
相似解决方案