在main.xml中
<SeekBar
android:visibility="visible"
android:id="@+id/skbProgress"
android:layout_width="450dip"
android:layout_height="21dip"
android:layout_marginTop="120dip"
android:thumb="@drawable/slide"
android:progressDrawable="@drawable/seekbar_img"
style="?android:attr/progressBarStyleHorizontal"
android:progress="0"
android:maxHeight="5dip"
android:minHeight="5dip"
android:layout_gravity="center_vertical"
/>
然后在res目录下新建一个drawable文件夹,将图片和seekbar_img配置文件放进去。
seekbar_img配置文件:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+android:id/background" android:drawable="@drawable/pdbg" />
<item android:id="@+android:id/progress" android:drawable="@drawable/pdbg2"/>
</layer-list>
![](https://img-my.csdn.net/uploads/201208/13/1344868541_7679.png)