1.
android:progressDrawable="@drawable/layer_list_progressbar"
该属性: 设置进度中的背景颜色和进度颜色
如下例子
<SeekBarandroid:id="@+id/player_seekbar"android:progressDrawable="@drawable/seekbar_style"android:background="@drawable/play_progress_background"android:layout_width="220dip"android:layout_height="wrap_content"android:thumb="@drawable/thumb"android:progress="0"android:max="0"/>
seekbar_style.xml 如下:
<?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:android:drawable="@drawable/play_progress_background"> </item> --> <item android:id="@android:id/progress"><clip android:drawable="@drawable/play_progress"></clip></item> </layer-list>
2.
android:thumb 设置拖动条的拖动按钮的样式图片
也可以为xml文件
<?xml version="1.0" encoding="utf-8"?>
<selectorxmlns:android="http://schemas.android.com/apk/res/android"><!-- 按下状态--> <item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/play_progress_thumb_pressed" /> <!-- 普通无焦点状态 --> <item android:state_focused="false" android:state_pressed="false" android:drawable="@drawable/play_progress_thumb_normal" /><!-- 有焦点状态--> <item android:state_focused="true" android:state_pressed="false" android:drawable="@drawable/play_progress_thumb_pressed" /><!-- 有焦点 --> <item android:state_focused="true" android:drawable="@drawable/play_progress_thumb_normal" /></selector>