搜索栏,由黄色变为路径颜色为白色 [英] Seek bar, change path color from yellow to white
问题描述
我有两个问题:
1)如何更改从黄(默认颜色搜索栏(路径)),以白的颜色。我的意思是说,当我将拇指,原来走过从灰色到黄线。我想曲目/线或者保持灰色或white..Basically我只想拇指移动在搜索栏没有颜色的变化。
1) how do I change the color of the seek bar (path) from yellow (the default color) to white. What I mean to say is, while I slide the thumb , it turns the line traversed from grey to yellow. I want track/line to either remain grey or white..Basically I want just the thumb to move with no color change in the seek bar.
2) 如何从矩形改变搜索栏的拇指圈/球/圆形。
2) How to change the thumb of seekbar from rectangle to circle/sphere/round shape.
任何指针将是AP preciated。
any pointers will be appreciated.
推荐答案
我想从上面填写答案谁是新的系统,
I want to complete the answer from above for the people who are new to the system,
缺少的XMLS(background_fill,progress_fill和进展可能看起来像一个渐变的红色
the missing xmls ( background_fill , progress_fill and progress could look like that for a gradient red
<?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/background_fill" />
<item android:id="@android:id/progress">
<clip android:drawable="@drawable/progress_fill" />
</item>
</layer-list>
background_fill.xml
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:startColor="#FF555555"
android:centerColor="#FF555555"
android:endColor="#FF555555"
android:angle="90" />
<corners android:radius="5px" />
<stroke
android:width="2dp"
android:color="#50999999" />
<stroke
android:width="1dp"
android:color="#70555555" />
</shape>
progress_fill.xml
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:startColor="#FF470000"
android:centerColor="#FFB80000"
android:endColor="#FFFF4400"
android:angle="180" />
<corners android:radius="5px" />
<stroke
android:width="2dp"
android:color="#50999999" />
<stroke
android:width="1dp"
android:color="#70555555" />
</shape>
我没有完成的实施为Android:拇指,这样拇指将仍然是原来的一个
i did not complete the implementing for android:thumb, so the thumb will be still the original one
因此,我们只需要再次从我们的布局XML我们定义搜索栏删除此行
Therefore we just have to delete this line again from our layout xml where we define the seekbar
android:thumb="@drawable/thumb"
祝你好运!
这篇关于搜索栏,由黄色变为路径颜色为白色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!