在anim/rotate.xml下
<?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android"> <rotate android:fromDegrees="0" android:toDegrees="359" android:duration="800" android:repeatCount="-1" android:pivotX="50%" android:pivotY="50%" /> </set>加载动画
Animation animation = AnimationUtils.loadAnimation(getActivity(), R.anim.loading_image);给控件设置动画
iv.startAnimation(animation);