私は誰かが同じような質問をするかどうか確かめようとしましたが、運がありませんでした。私はこのようなレイアウトを構築する方法を理解しようとしてきました:
最初はいくつかの異なるレイアウトを試しましたが、左側に2行のテーブルと右側に2 x 2行/列のテーブルがある2列のテーブルであるため、テーブルは機能する可能性があると思いましたが、TableLayout
どのように機能しませんか?考えました(列を追加する方法がわかりませんでした)。グリッドは私を近づけるように見えますが、画像のように画面をセクションに分割しようとするのではなく、ボタンの完全なグリッドを実行する場合にのみ機能するようです。
誰かアドバイスがありますか、またはこのようなことを最もよく達成する方法について正しい方向に私を向けることができますか?
ソリューションを投稿するのに十分な担当者がいませんが、このレイアウトに似たコードのクイックバージョンを次に示します(ボタンのみが拡大縮小されておらず、タイトルは画像です)。
<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"
tools:context=".MainMenu" >
<ImageButton
android:id="@+id/ImageButton03"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginRight="19dp"
android:layout_marginTop="27dp"
android:scaleType="fitCenter"
android:src="@drawable/ic_launcher" />
<ImageButton
android:id="@+id/ImageButton01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/ImageButton03"
android:layout_marginRight="108dp"
android:layout_toLeftOf="@+id/ImageButton03"
android:scaleType="fitCenter"
android:src="@drawable/ic_launcher" />
<ImageButton
android:id="@+id/ImageButton02"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/ImageButton01"
android:layout_alignParentBottom="true"
android:layout_marginBottom="29dp"
android:scaleType="fitCenter"
android:src="@drawable/ic_launcher" />
<ImageButton
android:id="@+id/ImageButton04"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/ImageButton02"
android:layout_toRightOf="@+id/ImageButton01"
android:scaleType="fitCenter"
android:src="@drawable/ic_launcher" />
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignTop="@+id/ImageButton01"
android:layout_marginLeft="18dp"
android:src="@drawable/ic_launcher" />
<ImageButton
android:id="@+id/ImageButton05"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/imageView1"
android:layout_alignParentBottom="true"
android:layout_marginBottom="14dp"
android:scaleType="fitCenter"
android:src="@drawable/ic_launcher" />