简体   繁体   English

android中的两个ListViews

[英]two ListViews in one, android

I'm creating a game in which the user can create a game and get invited to play a game . 我正在创建一个游戏,用户可以在其中创建游戏并被邀请玩游戏 I want to show the user a list of all the games he has created and all the games he has been invited to play in same Fragment , so the user can chose a game he wants to play. 我想向用户显示他创建 的所有游戏列表,以及邀请他在同一Fragment中 的所有游戏列表 ,以便用户可以选择他想玩的游戏。

header(my games)
list(first adapter)
header(games i have been invited to play)
list(secong adapter or first adapted but populated with different data)

I need to use different adapters for both lists , as the content will differ a bit from each other. 我需要为两个列表使用不同的适配器 ,因为内容会有所不同。 Ideally i would like to do this in one ListView if its possible? 理想情况下,如果可能,我想在一个ListView中执行此操作? To keep the content in one ScrollView. 将内容保留在一个ScrollView中。

In this case should i use sectioned ListView , ExpandableListView or in last case scenario two ListViews in a ScrollView ? 在这种情况下,我应该在ScrollView中使用分段的Lis​​tViewExpandableListView还是在最后一种情况下使用两个ListView

Suggestions, links, tutorials much appreciated! 建议,链接,教程不胜感激!

you could use the SectionedListAdapter from this link here for this potentially. 您可以在此处为此链接使用SectionedListAdapter

The adapter holds multiple adapters within it (my games + invited games), and just runs through both using getView() to populate the ListView 该适配器在其中包含多个适配器(我的游戏+邀请的游戏),并且仅使用getView()贯穿两个适配器来填充ListView

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM