android - listview fastscroll with alphabet like on iPhone contacts activity

dropsOfJupiter picture dropsOfJupiter · Feb 26, 2011 · Viewed 9.6k times · Source

Hi I am simply trying to implement an iPhone like fastscroll with an alphabetic scrollbar. See here: http://appsreviews.com/wp-content/uploads/2010/08/Cures-A-Z-App-for-iPhone.jpg

Surprisingly I cannot find anything like that for android.

Appreciate any help.

<ListView 
    android:id="@+id/lstItems" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:layout_below="@id/seekbarvalue" 
    android:scrollbarThumbVertical="@drawable/scrollbar_vertical_thumb" 
    android:scrollbarTrackVertical="@drawable/scrollbar_vertical_track"
    android:scrollbarSize="30dp"
    android:scrollbarStyle="insideOverlay"
    android:fadeScrollbars="false" />

Somebody commented on the subject in other threads: "if you are developing for android, all your apps app widgets should do similar things. No need to copy from iPhone." However, try to explain it to your client, who wants the app to look the same on most phones.enter image description here

Here is how it looks now: UGLY.

Answer

zrgiu picture zrgiu · Feb 26, 2011

try adding android:fastScrollEnabled to your ListView in the XML layout, that should get you pretty close to what you need.