一、AlphaAnimation
实现透明渐变效果
参数:float fromAlpha, float toAlpha
fromAlpha:动画开始显示度, toAlpha:动画结束显示度
二、RotateAnimation
实现图片旋转
参数:float fromDegrees, float toDegrees, int pivotXType, float pivotXValue, int pivotYType, float pivotYValue
fromDegrees: 开始旋转偏离值 toDegrees:结束旋转偏离值
pivotXType:X方向旋转模式 pivotXValue, pivotYType, pivotYValue
旋转模式有 四种: (Animation.ABSOLUTE, Animation.RELATIVE_TO_SELF, or Animation.RELATIVE_TO_PARENT),
例子:(0f, -360f,
Animation.RELATIVE_TO_SELF,0.5f,
Animation.RELATIVE_TO_SELF, 0.5f
);将以图片自身中心点为旋转轴点 按逆时针方向选转360度
三、TranslateAnimation
实现图片位置移动
参数:int fromXType, float fromXValue, int toXType, float toXValue, int fromYType, float fromYValue, int toYType, float toYValue
fromXValue:开始X坐标值 toXValue:结束X坐标值
四、ScaleAnimation
实现图片大小变化
参数:(float fromX, float toX, float fromY, float toY, int pivotXType, float pivotXValue, int pivotYType, float pivotYValue)
本文详细介绍了如何使用AlphaAnimation实现透明渐变效果、RotateAnimation完成图片旋转、TranslateAnimation达到图片位置移动以及ScaleAnimation来改变图片大小。每种动画类型都提供了具体的参数说明及示例。
265

被折叠的 条评论
为什么被折叠?



