当前位置: 移动技术网 > IT编程>网页制作>Html5 > 旋转动画

旋转动画

2018年10月25日  | 移动技术网IT编程  | 我要评论

[html] 
rotate_and_scale.xml 
[html] view plaincopy
<?xml version="1.0" encoding="utf-8"?> 
 
<set xmlns:android="https://schemas.android.com/apk/res/android"> 
    <rotate android:fromdegrees="0" android:todegrees="360" 
    android:pivotx="50%" android:pivoty="50%" 
    android:duration="5000" 
    android:repeatmode="restart" 
    android:repeatcount="infinite" /> 
</set> 

[java] 
  
final imageview img1=(imageview)this.findviewbyid(r.id.imageview1); 
button btn=(button)this.findviewbyid(r.id.button1); 
final animation mrotateanim= animationutils.loadanimation(this, r.anim.rotate_and_scale); 
btn.setonclicklistener(new onclicklistener() { 
             
<span style="white-space:pre">    </span>@override 
    public void onclick(view v) { 
        img1.setanimation(mrotateanim); 
    } 
}); 
作者:kechanghe0705

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网