在您的 res/drawable/green_progress.xml 中将此设置为可绘制对象
<?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:innerRadiusRatio="5"
android:shape="ring"
android:thicknessRatio="15"
android:useLevel="false" >
<size
android:height="48dip"
android:width="48dip" />
<gradient
android:centerColor="#FFFFFF"
android:centerY="0.50"
android:endColor="@android:color/transparent"
android:startColor="#4bd577"
android:type="sweep"
android:useLevel="false" />
</shape>
</rotate>
和你的进度条
android:indeterminateDrawable"@drawable/green_progress"
或者对于非圆形Progressbar 使用这个:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@android:id/background">
<shape>
<corners android:radius="0dip" />
<gradient android:startColor="#004676" android:centerColor="#004676"
android:centerY="0.75" android:endColor="#004676" android:angle="90" />
</shape>
</item>
<item android:id="@android:id/progress">
<clip>
<shape>
<corners android:radius="0dip" />
<gradient android:startColor="#ee7407" android:endColor="#ee7407"
android:angle="90" />
</shape>
</clip>
</item>
</layer-list>
为了您的进步:
android:progressDrawable="@drawable/myprogrogress"