我有一个 XML 布局如下。我有一个 TextView ,后面跟着一些复选框,然后是一个按钮。我已将所有复选框包含在一个线性布局中,并为此设置了一个 ScrollView 。`向下滚动后我无法查看我的按钮,我该怎么办?
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView />
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:orientation="vertical" >
<LinearLayout>
<CheckBox />
<CheckBox />
<CheckBox/>
<CheckBox/>
<CheckBox/>
<CheckBox/>
<CheckBox/>
<CheckBox/>
<CheckBox />
<CheckBox/>
<CheckBox />
</LinearLayout>
</ScrollView>
<Button
</Button>
</LinearLayout>
最佳答案
ScrollView 有条件 ScrollView 应该只有一个 subview subview 可能包含 subview
如果你想显示你有使用 View 怀特概念的按钮
<LinearLayout
<TextView
<ScrollView
<LinearLayout
<CheckBox
<CheckBox
<CheckBox
<CheckBox
.
<CheckBox
LinearLayout>
ScrollView>
<Button
android:layout_weight="1"
LinearLayout >
关于android - XML 布局 - 滚动后按钮不可见,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12759474/