Android的列表视图组视图、列表、Android

由网友(記憶)分享简介:我有活动,显示搜索结果。它扩展ListActivity。我需要显示在列表视图搜索结果划分几个项目。所以,我怎么添加分组到我的列表视图?I have Activity for displaying search results. It extends ListActivity. I need to show searc...

我有活动,显示搜索结果。它扩展ListActivity。我需要显示在列表视图搜索结果划分几个项目。所以,我怎么添加分组到我的列表视图?

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 listview?

推荐答案

你给你的的ListView A ListAdapter 的知道如何做分组。

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

这可能是覆盖 getViewTypeCount() getItemViewType()在适配器来形容其立场的问题得到这种种行,再加上修改 getView()(或 NewView的() bindView ()的CursorAdapter )的需要。

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.

根据您从开始什么,你也许能够使用的东西,像我 MergeAdapter 代替。

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

阅读全文

相关推荐

最新文章