画面に2つの相対レイアウトが必要です。上下に。このコードを作成しましたが、機能しません。この場合、両方が挿入された上部の相対レイアウトのみが表示され、wrap_contentを設定しても、このレイアウトはスペース全体を占有します。
編集!:私も失敗する2番目のコードの下に置きます。
編集2!:問題が見つかりました...それは少し...悲しいです。問題は私のテーマにあります。背景を大きすぎるpngファイルに設定しましたが、マニフェストを介してデフォルトのテーマを適用すると、これが発生しました。私がそれを取り除いたとき、それはすべて良いです。
このバージョンも失敗します。
新しいコード:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<RelativeLayout
android:id="@+id/some_id"
android:layout_above="@+id/some_id2"
android:layout_alignParentTop="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<Button
android:id="@+id/main_button_localize"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/main_localize" />
</RelativeLayout>
<RelativeLayout
android:id="@id/some_id2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true" >
<ToggleButton
android:id="@+id/main_help"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</RelativeLayout>
</RelativeLayout>
古いコード:
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<RelativeLayout
android:id="@+id/maps_manager_menu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true" >
<!-- Top -->
<Button
android:id="@+id/maps_manager_top_left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/empty" />
<Button
android:id="@+id/maps_manager_top_middle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/maps_manager_top_left"
android:contentDescription="@string/empty" />
<Button
android:id="@+id/maps_manager_top_right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/maps_manager_top_middle"
android:contentDescription="@string/empty" />
<!-- Middle -->
<Button
android:id="@+id/maps_manager_middle_left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/maps_manager_top_left"
android:contentDescription="@string/empty" />
<Button
android:id="@+id/maps_manager_middle_middle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/maps_manager_middle_left"
android:layout_below="@id/maps_manager_top_middle"
android:contentDescription="@string/empty" />
<Button
android:id="@+id/maps_manager_middle_right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/maps_manager_middle_middle"
android:layout_below="@id/maps_manager_top_right"
android:contentDescription="@string/empty" />
<!-- Bottom -->
<Button
android:id="@+id/maps_manager_bottom_left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/maps_manager_middle_left"
android:contentDescription="@string/empty" />
<Button
android:id="@+id/maps_manager_bottom_middle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/maps_manager_bottom_left"
android:layout_below="@id/maps_manager_middle_middle"
android:contentDescription="@string/empty" />
<Button
android:id="@+id/maps_manager_bottom_right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/maps_manager_bottom_middle"
android:layout_below="@id/maps_manager_middle_right"
android:contentDescription="@string/empty" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/maps_manager_controls"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignBottom="true"
android:layout_below="@id/maps_manager_menu" >
<ToggleButton
android:id="@+id/maps_manager_help"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</RelativeLayout>
</RelativeLayout>