xml文件
```
<set?
<rotate
android:fromDegrees="359"
android:toDegrees="0"
android:duration="1000"
android:repeatCount="-1"
android:pivotX="50%"
android:pivotY="50%"/>
</set>
代碼
/開始旋轉(zhuǎn)/
public voidstartRotateAnimation(View view, intsetid) {
Animation rotateAnim = AnimationUtils.loadAnimation(this,setid);
LinearInterpolator lin =newLinearInterpolator();
rotateAnim.setInterpolator(lin);
if(rotateAnim !=null) {
view.startAnimation(rotateAnim);
}
}
/*
停止旋轉(zhuǎn)
*/
public voidstopRotateAnimation(View v) {
v.clearAnimation();
}
```