I created a list view.I need to increase the width of the vertical scrollbar. I changed android:scrollbarSize. But it is not working .Also want to decrease length of scrollbar thumb.Is it posiible. Please help me.
<LinearLayout android:id="@+id/LinearLayout01"
android:layout_width="fill_parent" android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<ListView
android:id="@+id/list_view"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scrollbars="vertical"
android:scrollbarAlwaysDrawVerticalTrack="true"
android:scrollX="0px"
android:scrollY="0px"
android:background="#515151"
android:layout_weight="1"
android:scrollbarStyle="outsideOverlay"
android:divider="#FFF"
android:fadeScrollbars="false"
android:scrollbarSize="20dip"/>
</LinearLayout>
Your scrollbar will scale to the width/height of the resource that you specify for android:scrollbarTrackHorizontal and android:scrollbarTrackVertical.
This seems to be the only way to do it that I can figure out right now, and I'm not going to monkey around with it anymore ;)
So if you want an 8px wide horizontal track, and a 12px high vertical track. Create a PNG that is 8px wide for the horizontal track. Create a PNG that is 12px high for the horizontal track. Your nine patches for the android:scrollbarThumbHorizontal and android:scrollbarThumbHorizontal will automatically scale inside of these images.
<item name="android:scrollbarTrackHorizontal">@drawable/png_12px_high</item>
<item name="android:scrollbarTrackVertical">@drawable/png_8px_wide</item>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With