直播电商软件开发,拖动条自定义背景,进度条颜色相关的代码
<SeekBar
android:max="100"
android:maxHeight="6dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:thumb="@drawable/seek_bar_thumb"
android:progressDrawable="@drawable/seek_bar_bg"/>
seek_bar_thumb:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_selected="true">
<shape android:shape="oval">
<size android:height="15dp" android:width="15dp" />
<solid android:color="@color/widget_progress_red_color" />
</shape>
</item>
<item android:state_pressed="true">
<shape android:shape="oval">
<size android:height="15dp" android:width="15dp" />
<solid android:color="@color/widget_progress_red_color" />
</shape>
</item>
<item>
<shape android:shape="oval">
<size android:height="15dp" android:width="15dp" />
<solid android:color="@color/widget_progress_red_color" />
</shape>
</item>
</selector>
seek_bar_bg:
<?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>
<solid android:color="@color/widget_set_grey_background_color" />
<corners android:radius="10dp"/>
</shape>
</item>
<item android:id="@android:id/progress" >
<clip>
<shape>
<solid android:color="@color/widget_progress_red_color" />
<corners android:radius="10dp"/>
</shape>
</clip>
</item>
</layer-list>
以上就是直播电商软件开发,拖动条自定义背景,进度条颜色相关的代码, 更多内容欢迎关注之后的文章