开发者

is there a default way to make the first letter of the contents appear (eg as a hover) android

I have a listview in alphabetic order and a开发者_如何学Pythons the user scrolls i want a way to see the first letter.Like a phone catalog.


It seems you can do it using android.widget.AlphabetIndexer. See this link to the relevant file in Contacts git.

More generally the SectionIndexer interface, which AlphabetIndexer implements, seems to indicate that by implementing SectionIndexer you can enable fast scrolling between sections of a list.

android.widget.FastScroller is another key class. It does the actual drawing of the letters, so you probably want to check out that class.

See core/java/android/widget/FastScroller.java in the platform/frameworks/base.git for the source.


You can grab the src from the git repo and see how they did it!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜