有段头的Android名单 [英] Android List with section headers
问题描述
我试图创建一个头以上项目的分组列表。我一直在寻找SeperatedListAdapter可以在这里找到: http://jsharkey.org/blog/2008/08/18/separating-lists-with-headers-in-android-09/ 但我遇到了一个错误(ERROR / AndroidRuntime (2025):
I'm trying to create a list with headers above a grouping of items. I was looking at SeperatedListAdapter available here: http://jsharkey.org/blog/2008/08/18/separating-lists-with-headers-in-android-09/ but I ran into an error (ERROR/AndroidRuntime(2025):
java.lang.IllegalStateException: ArrayAdapter requires the resource ID to be a TextView
)
现在我正在寻找到更多的选项,包括制定一个新的。难道你们有什么提示吗?
Now I'm looking into more options including making a new one. Do you guys have any hints?
谢谢, 拜伦
推荐答案
AFAIK,夏基先生的code工作得很好。您可能使用了错误的 ArrayAdapter
的构造。
AFAIK, Mr. Sharkey's code works just fine. You may be using the wrong ArrayAdapter
constructor.
您也可以使用我的 MergeAdapter
来实现相同的目的。
You can also use my MergeAdapter
to achieve the same ends.
这篇关于有段头的Android名单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!