1、利用shape
<?xml version="1.0" encoding="utf-8"?> <rotate xmlns:android="http://schemas.android.com/apk/res/android" android:fromDegrees="0" android:pivotX="50%" android:pivotY="50%" android:toDegrees="360" > <shape android:shape="ring" android:innerRadiusRatio="3" android:thicknessRatio="15" android:useLevel="false"> <!-- 扫描渐变 --> <gradient android:type="sweep" android:useLevel="false" android:startColor="#222222" android:centerColor="#666666" android:endColor="#ffffff" android:centerX="0.5" android:centerY="0.5" /> </shape> </rotate>