ScaleAnimation(float fromX, float toX, float fromY, float toY,int pivotXType, float pivotXValue, int pivotYType, float pivotYValue)
float fromX 動畫起始時 X座標上的伸縮尺寸
float toX 動畫結束時 X座標上的伸縮尺寸
float fromY 動畫起始時Y座標上的伸縮尺寸
float toY 動畫結束時Y座標上的伸縮尺寸
int pivotXType 動畫在X軸相對於物件位置類型
float pivotXValue 動畫相對於物件的X座標的開始位置
int pivotYType 動畫在Y軸相對於物件位置類型
float pivotYValue 動畫相對於物件的Y座標的開始位置
//----------------------------------------------------------------------------------------------
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座標上的差值
animation.setDuration(long durationMillis);//設置動畫持續時間
animation.setRepeatCount(int i);//設置重複次數
animation.setRepeatMode(Animation.REVERSE);//設置反方向執行
//-----------------------------------------------------------------------------------------------
RotateAnimation
(float fromDegrees, float toDegrees, int pivotXType, float pivotXValue, int pivotYType, float pivotYValue)
參數說明:
float fromDegrees:旋轉的開始角度。
float toDegrees:旋轉的結束角度。
int pivotXType:X軸的伸縮模式,可以取值爲ABSOLUTE、RELATIVE_TO_SELF、RELATIVE_TO_PARENT。
float pivotXValue:X座標的伸縮值。
int pivotYType:Y軸的伸縮模式,可以取值爲ABSOLUTE、RELATIVE_TO_SELF、RELATIVE_TO_PARENT。
float pivotYValue:Y座標的伸縮值。