我創建了一個menuView.xml佈局,以便放入我的活動的所有佈局中。這種佈局對每個邊界一列這樣一個標題欄:調整佈局以進入其他佈局
ComposeView http://img845.imageshack.us/img845/2121/d6zp.png
我在其他佈局這種方式插入此佈局:
<!-- Show menu -->
<com.example.MenuView
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
但是,如果佈局中的一個具有完全屏幕視圖,這個視圖的一部分被MenuView所覆蓋,所以...
我怎麼能告訴這個視圖,以適應其大小的MenuView中的空白空間不被它覆蓋?
更新 - 完整的XML包括
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:background="@drawable/degradado">
<!-- Show menu -->
<com.example.MenuView
android:layout_width="match_parent"
android:layout_height="match_parent" />
<RelativeLayout
android:id="@+id/Left_layout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentBottom="true" >
//Here go buttons, views, etc...
</RelativeLayout>
<RelativeLayout
android:id="@+id/Right_layout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true" >
//Here go buttons, views, etc...
</RelativeLayout>
這裏會發生什麼情況是,這些2個相對佈局得到由MenuView(最黑暗的GRE邊框和頂部黑條)覆蓋,理想的方式是將這兩種佈局合併到空白區域(最清晰的灰色)。
我可以解決這個設置邊緣大小的相對佈局,以適應其內部,但我知道這不是最好的方式來做到這一點,所以我不知道是否有另一種方式。
對不起,我的android知識,我找不到更好的方式來做到這一點。我會刪除我的舊答案,因爲它沒用。我希望有人很快發佈答案。 –
好的沒問題,謝謝你的幫助 – masmic