像上图这样的东西。 我有一个巨大的列表,其中包含从列表中的数据库填充的数据。
我已经使用索引适配器通过 fastscroll 对列表进行索引,现在我想按字母顺序对它们进行分组
任何人都可以给我任何想法来做到这一点.. 我在网上到处找,但找不到好的解决方案
ArrayList<String> list= new ArrayList<String>();
MyIndexerAdapter<String> adapter = new MyIndexerAdapter<String>(
getApplicationContext(), android.R.layout.simple_list_item_1,
list);
lv.setAdapter(adapter);
最佳答案
您可以安装 demo在 Android Market 中可用,并查看 Tweaked ItemVew 部分。代码可见here .
http://lh6.ggpht.com/_OHO4y8YcQbs/TQFQTfazM2I/AAAAAAAAMpQ/lgPpIKImdZw/s288/gd5.png
- Mark Murphy 的
SectionedAdapter
还有一个更轻量级的解决方案.
关于android - android中列表的动态标题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5474147/