gpt4 book ai didi

android - 如何在 ScrollView 中将 LinearLayout 高度设置为匹配父级

转载 作者:行者123 更新时间:2023-12-03 23:22:04 25 4
gpt4 key购买 nike

下面是我的 .XML 代码。我能有一个解决这个问题的方法吗?

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/ticket_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:isScrollContainer="true">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"/>

</ScrollView>

最佳答案

试试这个,我想它可以帮助你。

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/ticket_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:isScrollContainer="true">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"/>

</ScrollView>

关于android - 如何在 ScrollView 中将 LinearLayout 高度设置为匹配父级,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50578024/

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