Java Android seekbar定制
我正在尝试定制和安装android seekbar(使用API 17),这样整个进度条线都是蓝色的 我在res/drawable中创建了以下XML: draw\u seekbar\u settings.xmlJava Android seekbar定制,java,android,Java,Android,我正在尝试定制和安装android seekbar(使用API 17),这样整个进度条线都是蓝色的 我在res/drawable中创建了以下XML: draw\u seekbar\u settings.xml <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item>
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<clip>
<shape
android:shape="line">
<stroke
android:color="@color/progressFxBar"
android:width="2dp"
/>
</shape>
</clip>
</item>
</selector>
及
更改绘图seekbar\u设置.xml如下:
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Define the background properties like color etc -->
<item android:id="@android:id/background">
<shape
android:shape="line">
<stroke
android:color="@color/progressFxBar"
android:width="2dp"
/>
</shape>
</item>
<!-- Define the progress properties like start color, end color etc -->
<!-- if you want to change the progress edit following -->
<item android:id="@android:id/progress">
<clip>
<shape>
<gradient
android:startColor="#007A00"
android:centerColor="#007A00"
android:centerY="1.0"
android:endColor="#06101d"
android:angle="270"
/>
</shape>
</clip>
</item>
</layer-list>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Define the background properties like color etc -->
<item android:id="@android:id/background">
<shape
android:shape="line">
<stroke
android:color="@color/progressFxBar"
android:width="2dp"
/>
</shape>
</item>
<!-- Define the progress properties like start color, end color etc -->
<!-- if you want to change the progress edit following -->
<item android:id="@android:id/progress">
<clip>
<shape>
<gradient
android:startColor="#007A00"
android:centerColor="#007A00"
android:centerY="1.0"
android:endColor="#06101d"
android:angle="270"
/>
</shape>
</clip>
</item>
</layer-list>