Android - ImageView图形不断旋转的动画


1.  res下建立一个动画文件夹anim
2.  anim文件夹下面建立名称为:rotaterepeat动画xml文件

    <?xml version="1.0" encoding="utf-8"?>
  <set xmlns:android="http://schemas.android.com/apk/res/android" > 
        <rotate 
            android:duration="1000" 
            android:fromDegrees="0" 
            android:interpolator="@android:anim/linear_interpolator" 
            android:pivotX="50%" 
            android:pivotY="50%" 
            android:repeatCount="-1" 
            android:toDegrees="360" />
    </set> 
3. Activity文件下

ImageView mAnimationView = (ImageView) findViewById(R.id.animation); 
mAnimation = AnimationUtils.loadAnimation(this, R.anim.rotaterepeat); 
mAnimationView.startAnimation(mAnimation); 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM