1、布局文件代码:
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:indeterminateDrawable="@drawable/progressbar_red" />
2、在drawable目录下新建XML文件progressbar_red:
<?xml version="1.0" encoding="utf-8"?>
<animated-rotate
xmlns:android="http://schemas.android.com/apk/res/android"
android:fromDegrees="0"
android:toDegrees="360"
android:pivotX="50%"
android:pivotY="50%"
>
<shape
android:shape="ring"
android:innerRadiusRatio="4"
android:thicknessRatio="8"
android:useLevel="false"
>
<gradient
android:type="sweep&#