1. res/drawable下面 建立 pro_bg..xml:
01 |
<?xml "1.0" encoding= "UTF-8" ?> |
02 |
03 |
<layer-list "http://schemas.android.com/apk/res/android" > |
04 |
05 |
<!-- 设置背景色图像资源 --> |
06 |
07 |
<item "@android:id/background" android:drawable= "@drawable/bg" /> |
08 |
09 |
<!-- 设置第二级进度条颜色图像资源 --> |
10 |
11 |
<item "@android:id/secondaryProgress" android:drawable= "@drawable/secondary" /> |
12 |
13 |
<!-- 设置第一级进度条颜色图像资源 --> |
14 |
15 |
<item "@android:id/progress" android:drawable= "@drawable/progress" /> |
16 |
</layer-list> |
然后指定progressbar中的android:progressDrawable="@drawable/pro_bg"属性即可,该属性值为刚才建立的xml文件