先在drawable下建立一个my_progressbar.xml
<?xml version="1.0" encoding="utf-8"?>
<animated-rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:fromDegrees="0"
android:pivotX="50%"
android:pivotY="50%"
android:toDegrees="360" >
<shape
android:innerRadiusRatio="3"
android:shape="ring"
android:thicknessRatio="8"
android:useLevel="false" >
<gradient
android:centerColor="#FF7121"
android:centerY="0.50"
android:endColor="#FFFF00"
android:startColor="#6BD3FF"
android:type="sweep"
android:useLevel="false" />
</shape>
</animated-rotate>
然后在ProgressBar控件属性添加
android:indeterminateDrawable="@drawable/my_progressbar"