Android listview groups

前端 未结 1 1845
轻奢々
轻奢々 2020-12-21 07:51

I have Activity for displaying search results. It extends ListActivity. I need to show search results in listview grouping several items. So, how do I add grouping to my lis

相关标签:
1条回答
  • 2020-12-21 08:44

    You give your ListView a ListAdapter that knows how to do the grouping.

    This could be a matter of overriding getViewTypeCount() and getItemViewType() in the adapter to describe which positions get which sorts of rows, plus modifying getView() (or newView() and bindView() for CursorAdapter) as needed.

    Depending on what you are starting with, you might be able to use something like my MergeAdapter instead.

    0 讨论(0)
提交回复
热议问题