views:

255

answers:

0

Hi, I'm trying to modify a ListView scrollbar's width without success

<ListView
    android:id="@+id/android:list"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:choiceMode="singleChoice"
    android:scrollbars="vertical"
    android:scrollbarTrackVertical="@drawable/scrollbar_vertical_track"
    android:scrollbarThumbVertical="@drawable/scrollbar_vertical_thumb"
    android:scrollbarSize="4px"
    android:clickable="true"/>

First I tried using a drawable image 4px wide, but the .png was resized. Then I tried using a shape extracted from SamplesApi, without success.

<shape 
xmlns:android="http://schemas.android.com/apk/res/android" 
android:width="40px">
<gradient android:startColor="#505050" android:endColor="#C0C0C0"
        android:angle="0"/>
<corners android:radius="0dp" />

I've tried with and without the android:width attribute.

There's a question on the same topic (http://stackoverflow.com/questions/2565083/width-of-a-scroll-bar-in-android), but it doesn't try anything different that what I'm already trying. As far as I know, creating my own theme shouldn't change the output.

There's an example in SamplesApi (Views/ScrollBars). I tried modifying the scrollbarSize attribute without result.

I know about ninepatch images, but there's an attribute which should do what I want.

Any hint? Thanks in advance.