使用多个数据源填充listview

时间:2015-02-12 19:05:37

标签: android android-layout android-listview android-scrollview

是否可以使用4个不同的来源填充相同的列表视图?

目前我的设计是一个 的TextView 列表显示 的TextView 列表视图

我不喜欢的是两个listview独立滚动所以如果顶部的几乎是空的,我的屏幕上有很多空的空间, 如果我没有将顶部尺寸设置为固定尺寸且非常满,则不会显示底部尺寸。

我想有一个listview / scrollview,所以所有内容都很好地独立于我用于填充列表视图的任一数组中的条目数。

可以做到吗? 感谢

这是我上面提到的xml

 <TextView
    android:id="@+id/gamesView"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_below="@id/top_btns"
    android:gravity="center"
    android:text="@string/gamesView"
    android:textColor="#FFFFFF"/>

<ListView
    android:id="@+id/gameslist"
    android:layout_width="match_parent"
    android:layout_height="260dip"
    android:layout_below="@id/gamesView" />

<TextView
    android:id="@+id/finishedGamesView"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_below="@id/gameslist"
    android:gravity="center"
    android:text="@string/endedGamesView"
    android:textColor="#FFFFFF"/>

<ListView
    android:id="@+id/finishedgameslist"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_below="@id/finishedGamesView" />

0 个答案:

没有答案
相关问题