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

android动画

2015-12-07 15:22 281 查看
/**
* 旋转方法
*/
public void moveImg(ImageView iv, boolean b) {
final float centerX = iv.getWidth() / 2.0f;
final float centerY = iv.getHeight() / 2.0f;
RotateAnimation rotateAnimation;
if (!b) {
rotateAnimation = new RotateAnimation(0, 90, centerX,
centerY);
} else {
rotateAnimation = new RotateAnimation(90, 0, centerX,
centerY);
}
rotateAnimation.setDuration(500);
rotateAnimation.setFillAfter(true);
iv.startAnimation(rotateAnimation);

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: