我有Android佈局問題。我有(1)一個ScrollView(2)一個TableLayout(3)頁腳LinearLayout。 目前,如果TableRow太多,表格將重疊頁腳佈局。 以下是我的xml佈局。Android:兩個LinearLayout在ScrollView中重疊
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#F7F7F7">
<LinearLayout
android:id="@+id/account_section"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Head Text" />
<TableLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TableRow
android:layout_width="wrap_content"
android:layout_height="100dp"
android:background="#CCCCCC">
<TextView
android:layout_width="wrap_content"
android:layout_height="100dp"
android:text="1" />
</TableRow>
<TableRow
android:layout_width="wrap_content"
android:layout_height="100dp"
android:background="#CCCCCC">
<TextView
android:layout_width="wrap_content"
android:layout_height="100dp"
android:text="2" />
</TableRow>
<TableRow
android:layout_width="wrap_content"
android:layout_height="100dp"
android:background="#CCCCCC">
<TextView
android:layout_width="wrap_content"
android:layout_height="100dp"
android:text="3" />
</TableRow>
</TableLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/footer_section"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="vertical">
<ImageView
android:id="@+id/footer_image"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@drawable/footer_image" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="@dimen/footer_height"
android:background="#333333">
<TextView
android:id="@+id/usage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="Test" />
<TextView
android:id="@+id/dashboard_copy_right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="@string/copy_right" />
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
</ScrollView>
如果TableRow太多,「表」將與「頁腳」重疊。 如何解決這個佈局問題?
在此先感謝。 埃裏克
添加截圖
這可能是因爲你已經硬編碼了'機器人:layout_height = 「100dp」'。你不能把它設置爲'wrap_content'或'fill_parent'嗎? – 2015-02-12 07:33:06
不,我測試過了,它不是硬編碼的100dp問題 – 2015-02-12 07:38:55
您可以發佈顯示問題的屏幕截圖嗎? – 2015-02-12 07:40:12