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