1.xml代码方式一:如下(此shape是放到drawable目录下的)
<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="#ff0000"
android:endColor="#111111"
android:startColor="#B23AEE"
android:type="sweep"
android:useLevel="false" />
</shape>
</rotate>
2.看下效果图:
</