美文网首页
动画的使用

动画的使用

作者: 未聞椛洺 | 来源:发表于2017-11-16 17:04 被阅读0次

1、View动画 

绕Z轴 均匀快速 旋转360度

Animation  anim =  new  RotateAnimation(0f, 360f,  Animation.RELATIVE_TO_SELF, 0.5f,         Animation.RELATIVE_TO_SELF, 0.5f);    

anim.setFillAfter(true);

anim.setRepeatCount(1);

anim.setFillAfter(true);

anim.setDuration(350);

anim.setInterpolator(new LinearInterpolator());

view.startAnimation(anim); //绑定目标

2、 属性动画

绕Z轴 均匀快速 旋转360度

ObjectAnimator .ofFloat(iv, "rotation", 0.0F, 360.0F) .setDuration(350) .start();

相关文章

网友评论

      本文标题:动画的使用

      本文链接:https://www.haomeiwen.com/subject/soxrvxtx.html