【发布时间】:2013-05-02 06:16:46
【问题描述】:
我有 2 个 ListView,每个都从网站数据库中获取信息.... 一切都很好,但我想要的是显示第一个列表视图,然后在它下面显示第二个列表视图而不设置固定高度..就像用户应该滚动到第一个列表视图的末尾,然后显示第二个列表视图而不显示滚动条。这是我所做的:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ListView
android:id="@+id/firstlist"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
</ListView>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<ListView
android:id="@+id/secondlist"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
</ListView>
</RelativeLayout>
</LinearLayout>
但即使我继续滚动屏幕也不会同时显示,只有一个列表视图(第一个)显示...除非我给它们固定高度,例如 android:layout_height="180dp" 任何想法?
【问题讨论】: