Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/204.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 我想在滚动时显示此列表视图_Android - Fatal编程技术网

Android 我想在滚动时显示此列表视图

Android 我想在滚动时显示此列表视图,android,Android,我在这件事上完全被难住了。我有三个不同的列表需要显示在屏幕上。 我曾尝试使用带有LinearLayout子级的ScrollView,并将我的ListView放入LinearView,但所有ListView都使用滚动条锁定到固定高度。使用其他类型的布局意味着没有滚动 线性布局中列表视图的高度取决于您对其进行加权的方式 你有一些示例代码吗 尝试此未测试的布局 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/andr

我在这件事上完全被难住了。我有三个不同的列表需要显示在屏幕上。
我曾尝试使用带有LinearLayout子级的ScrollView,并将我的ListView放入LinearView,但所有ListView都使用滚动条锁定到固定高度。使用其他类型的布局意味着没有滚动

线性布局中列表视图的高度取决于您对其进行加权的方式

你有一些示例代码吗

尝试此未测试的布局

<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:width="fill_parent"
android:height="fill_parent"
android:orientation="vertical"
>

<ListView
android:id="@+id/list1"
android:width="fill_parent"
android:height="fill_parent"
android:layout_weight="1"
>

<ListView
android:id="@+id/list2"
android:width="fill_parent"
android:height="fill_parent"
android:layout_weight="1"
>

<ListView
android:id="@+id/list3"
android:width="fill_parent"
android:height="fill_parent"
android:layout_weight="1"
>

</LinearLayout>

ListView知道如何滚动。你不必把它放在Scrollview中。画一张图,告诉我们你想要实现什么。你不仅不需要把它放在滚动视图中,而且它在滚动视图中也不起作用。