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