下面是我的 .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/