旋转动画
作者:
向右45 | 来源:发表于
2018-10-25 10:07 被阅读0次 private RotateAnimation rotateAnimation;
ImageView imageView = mView.findViewById(R.id.icon);//获取控件imageView
rotateAnimation = new RotateAnimation(0f, 360f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
rotateAnimation.setInterpolator(new LinearInterpolator());
rotateAnimation.setDuration(500);//设置动画持续周期
rotateAnimation.setRepeatCount(Integer.MAX_VALUE);//设置重复次数
rotateAnimation.setFillAfter(false);//动画执行完后是否停留在执行完的状态
imageView.startAnimation(rotateAnimation);//开始动画
//结束动画
if (rotateAnimation != null) {
rotateAnimation.cancel();
rotateAnimation = null;
}
本文标题:旋转动画
本文链接:https://www.haomeiwen.com/subject/jrlqtqtx.html
网友评论