1,在anim文件夹中新建一个动画
<?xml version="1.0" encoding="utf-8"?>
<animated-rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/ic_progress"
android:pivotX="50.0%"
android:pivotY="50.0%" />
2,写一个style.
<style name="progressbar_style1">
<item name="android:maxWidth">50.0dip</item>
<item name="android:maxHeight">50.0dip</item>
<item name="android:indeterminateDrawable">@anim/anim_loading1</item>
<item name="android:minWidth">50.0dip</item>
<item name="android:minHeight">50.0dip</item>
</style>
3,在布局中直接使用这个progressBar
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/progressbar_style1"/>
只要设置好它的样式即可.