当前位置: 首页 > 工具软件 > pivotx > 使用案例 >

3个gif动画让你明白RotateAnimation的pivotX与pivotY

邓元白
2023-12-01

3个gif动画让你明白RotateAnimation的pivotX与pivotY

刚开始接触android中的动画(Animation),其中构造函数是这样的:

/*
参数1:float fromDegrees 开始旋转角度
参数2:float toDegrees 结束旋转角度
参数3:int pivotXType  X轴起始点类型
//如RotateAnimation.RELATIVE_TO_SELF | RELATIVE_TO_PARENT
参数4:float pivotXValue   X轴起始点值
参数5:int pivotYType  Y轴起始点类型
参数6:float pivotYValue   Y轴起始点值
*/
RotateAnimation ra = new RotateAnimation(0, 360, RotateAnimation.RELATIVE_TO_SELF, 0.5f, RotateAnimation.RELATIVE_TO_SELF, 0.5f);

参数1、2、3比较好理解,就是参数4、6不是很好理解。如是在网上查询有些人也解释了,但是总觉得含糊其辞、解释的不明不白的,没办法还是自己动手了。不多说,看图吧!

 类似资料: