开发者

Android List with section headers

开发者 https://www.devze.com 2022-12-27 19:36 出处:网络
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-0

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 o开发者_如何学JAVAptions including making a new one. Do you guys have any hints?

Thanks, Bryon


AFAIK, Mr. Sharkey's code works just fine. You may be using the wrong ArrayAdapter constructor.

You can also use my MergeAdapter to achieve the same ends.


That's how I solved the sectioning in ListViews with an ArrayAdapter http://bartinger.at/listview-with-sectionsseparators/


We have this same problem and have found the following two projects that meet our needs:

  • StickyListHeaders
  • StickyGridHeaders
0

精彩评论

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