android - listview fastscroll with alphabet like on iPhone contacts activity

杀马特。学长 韩版系。学妹 提交于 2019-12-11 20:57:52

问题


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.

Here is how it looks now: UGLY.


回答1:


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



来源:https://stackoverflow.com/questions/5129250/android-listview-fastscroll-with-alphabet-like-on-iphone-contacts-activity

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!