android控件旋转一圈动画封装

简单的封装,从fromDegrees 转toDegrees 延续时间durationMillis
mIv_logo.startAnimation(getRotateAnimation(0, 360, 500));
public static Animation getRotateAnimation(float fromDegrees,
			float toDegrees, int durationMillis) {
		RotateAnimation rotate = new RotateAnimation(fromDegrees, toDegrees,
				Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
				0.5f);
		rotate.setDuration(durationMillis);
		rotate.setFillAfter(true);
		return rotate;
	}

整个界面忽然就活泼了很多,适合圆形的控件

你可能感兴趣的:(android控件旋转一圈动画封装)