Android 旋转动画

来源:互联网 发布:天梭手表怎么样 知乎 编辑:程序博客网 时间:2024/04/30 20:00
public static void startAnimOut(RelativeLayout view, long Offset){        RotateAnimation animation = new RotateAnimation(0,180,view.getWidth()/2,view.getHeight());        animation.setDuration(500);//设置动画持续时间        animation.setStartOffset(Offset);//执行前的等待时间                animation.setFillAfter(true);//动画执行完后是否停留在执行完的状态        view.startAnimation(animation);    }

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坐标的伸缩值。 


做个笔记方便以后查阅

0 0