我有多個LinearLayout,其總高度很容易超過設備的屏幕高度。因此,為了使布局可滾動,我嘗試添加ScrollView,但不幸的是出現(xiàn)以下錯誤:Scrollview只能容納一個直子我做了一些研究,但是即使閱讀了幾個解決方案,也無法真正解決問題。我嘗試了一些更改,但到目前為止沒有任何效果。有什么幫助嗎?<?xml version="1.0" encoding="utf-8"?><ScrollView xmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="fill_parent"android:layout_height="fill_parent"android:orientation="vertical" > <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:paddingTop="20dip"> <TextView android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:text="Question 1" android:paddingBottom="20dip" android:gravity="center" /> <TextView android:id="@+id/q1_score" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:text="" android:gravity="center"/></LinearLayout><LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <TextView android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:text="Question 2" android:paddingBottom="20dip" android:gravity="center" /> <TextView android:id="@+id/q2_score" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:text="" android:gravity="center"/></LinearLayout>
- 1 回答
- 0 關注
- 456 瀏覽
添加回答
舉報
0/150
提交
取消