1
這裏是我的xml:的RelativeLayout:共享光幕高度
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<LinearLayout android:layout_alignParentTop="true"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:id="@+id/llRow1" />
<LinearLayout android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_below="@+id/llRow1"
android:id="@+id/llRow2" />
<LinearLayout android:layout_alignParentBottom="true"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:id="@+id/llRow3" >
</RelativeLayout>
我想什麼都有: - 這3個「行」已共享屏幕高度 - 但有一個額外的:當我設置第3行(llRow3)對GONE的可見性,只有row1和row2必須共享屏幕高度。
怎麼可能做到這一點?
Layout_weight心不是可用... :( – Prexx
啊,你沒有看到你使用了一個RelitiveLayout作爲你的ParentLayout,你可以將這三個LinearLayout包裝在另一個LinearLayout中嗎?這可以解決這個問題 – Ahmad
好主意,我會試試這個:) – Prexx