您的位置:首页 > 移动开发 > Android开发

android控件旋转一圈动画封装

2013-07-25 11:27 190 查看
简单的封装,从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;
}


整个界面忽然就活泼了很多,适合圆形的控件
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: