Listview每个item中包含fragment,适配器如何写
Listview每个item中包含fragment,适配器怎么写
请问各位各位一个问题,现在的项目有这个么一个需求,listview中的item中包含两项内容,一个文字和一个自定义的fragment,
请问这么listview的adapter应该怎么写。
------解决方案--------------------
这样做是不允许的,参考下这个吧
------解决方案--------------------
学习了。顺便翻译下楼上给的链接:
Fragment are managed by Activity's FragmentManager or by other Fragments child FragmentManager; while list item views are managed by ListView & ListAdapter. You can use ListViews in Fragments, but not the other way around.
Fragment需要使用FragmentManager管理。
list item 是使用 ListView & ListAdapter管理的。
可以在Fragments使用ListViews,反过来却不行。
请问各位各位一个问题,现在的项目有这个么一个需求,listview中的item中包含两项内容,一个文字和一个自定义的fragment,
请问这么listview的adapter应该怎么写。
------解决方案--------------------
这样做是不允许的,参考下这个吧
------解决方案--------------------
学习了。顺便翻译下楼上给的链接:
Fragment are managed by Activity's FragmentManager or by other Fragments child FragmentManager; while list item views are managed by ListView & ListAdapter. You can use ListViews in Fragments, but not the other way around.
Fragment需要使用FragmentManager管理。
list item 是使用 ListView & ListAdapter管理的。
可以在Fragments使用ListViews,反过来却不行。