gpt4 book ai didi

Android,如何将 ScrollView 添加到有一些列表项的屏幕中?

转载 作者:搜寻专家 更新时间:2023-11-01 07:36:29 25 4
gpt4 key购买 nike

在我的 Activity 中,我有三个列表。运行应用程序后,屏幕不可滚动。我可以滚动位于其他列表之上的列表,但我无法滚动整个页面。我试图将 ScrollView 添加到我的 xml 布局中,但 lint 说“垂直滚动的 ScrollView 不应包含另一个垂直滚动的小部件 (ListView)”。

如何使我的屏幕可滚动?

最佳答案

试试这个

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">

<LinearLayout android:id="@+id/GlobalLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >

<ListView android:id="@+id/ListView1"
android:choiceMode="multipleChoice"
android:layout_height="100dip"
android:layout_width="fill_parent" />
<ListView android:id="@+id/ListView2"
android:choiceMode="multipleChoice"
android:layout_height="100dip"
android:layout_width="fill_parent" />
<ListView android:id="@+id/ListView3"
android:choiceMode="multipleChoice"
android:layout_height="100dip"
android:layout_width="fill_parent" />

</LinearLayout>

</ScrollView>

关于Android,如何将 ScrollView 添加到有一些列表项的屏幕中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10496804/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com