0

in application listview i had more than 1000 data in listview and its tedious to scroll. i try to change scroll thume but cannot change.i requre scroll thum like below image

<ListView android:id="@+id/listview" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_below="@+id/layoutProduct" android:background="#00000000" android:cacheColorHint="#00000000" android:dividerHeight="1dp" android:fadeScrollbars="true" android:fadingEdge="none" android:scrollbarSize="10dp" android:scrollbarThumbVertical="@drawable/a_apptheme_fastscroll_thumb_holo" android:focusable="true" android:focusableInTouchMode="true" android:listSelector="#00000000" android:scrollingCache="false" > </ListView> 

Thum Image

User can drag scrol thume

2 Answers 2

1

Call the setFastScrollEnabled(true); method on your ListView. http://developer.android.com/reference/android/widget/AbsListView.html#setFastScrollEnabled(boolean)

Sign up to request clarification or add additional context in comments.

4 Comments

thanks it working in latest api it's looks diffrent but the thing exact i want that got
You can change the the Drawable with a style.. If I remember correctly.
like this android:scrollbarThumbVertical="@drawable/a_apptheme_fastscroll_thumb_holo"?
Add android:fastScrollThumbDrawable to you theme.
0

In your ListView XML definition, add

android:fastScrollEnabled="true" android:fastScrollAlwaysVisible="true" 

Create file fastscroll_thumb.xml in the res/drawable folder as follows:

<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true" android:drawable="@drawable/fastscroll_pressed" /> <item android:drawable="@drawable/fastscroll" /> </selector> 

Create a values folder in the res folder. Create themes.xml files in res/values as follows:

<resources> <style name="ApplicationTheme"> <item name="android:fastScrollThumbDrawable">@drawable/fastscroll_thumb</item> </style> </resources> 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.