【发布时间】:2012-09-06 01:08:18
【问题描述】:
我有一个在 ListView 中显示结果的搜索功能。我发现很难实现按字母顺序排列的列表。请告诉我怎么做。
【问题讨论】:
我有一个在 ListView 中显示结果的搜索功能。我发现很难实现按字母顺序排列的列表。请告诉我怎么做。
【问题讨论】:
您可以使用 Google 找到大量此主题。在我看来,这里有一些最好的教程。基本上,您使用 SectionIndexer 在适配器的 getView 方法中创建索引和显示(或隐藏)视图。
1,ListView Tips & Tricks #2: Sectioning your ListView,作者:Cyril Mottier。
2,Pinned Header ListView as in the Contacts app,作者:Peter Kuterna。
3,IndexableListView Daniel Nam