0

I'm playing a bit with Android developing some sample applications and came across issue I can't get over with. I'd like to change width of "bar" of SeekBar view.

What I want could be better seen on screenshot provided

http://i.stack.imgur.com/XczAf.png

Could some please be so kind and help me out?

Thanks a lot in advance

4

2 回答 2

1

您可以使用 thumb drawable 来更改高度和拇指图像 在 seekbar xml 文件中使用下面的行

android:thumb="@drawable/seekbar_thumb_draw"



<SeekBar
android:id="@+id/seekBar1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:thumb="@drawable/seekbar_thumb_draw" />

//seekbar_thumb_draw.xml

<?xml version="1.0" encoding="utf-8"?>

<item>
    <shape>
        <size
            android:height="40dp"
            android:width="40dp" />

        <solid android:color="@android:color/transparent" />
    </shape>
</item>
<item android:drawable="@drawable/seekbar_thumb_image"/>

seekbar_thumb_image 是您想要的拇指图像

于 2015-12-23T07:12:36.800 回答
0

您想要的确切尺寸。然后将其保存在您的drawables文件夹中。然后在您的搜索栏的 xml 代码中引用它。

<SeekBar
        android:id="@+id/seekBar1"
        android:layout_width="wrap_contentt"
        android:layout_height="wrap_content"
        android:thumb="@drawable/seek_thumb_verywidebar" />
于 2012-04-18T23:54:17.187 回答