レイアウトの下部近くに画像ボタンが並んでいるので、正方形のサイコロが 5 個あります。レイアウトの幅全体を占めるようにしたいのですが、幅全体を占めながら、その縦横比を適切に維持することができないようです。現在、私のコードは次のようになっています。
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="60dp"
android:layout_margin="1dp"
android:layout_gravity="bottom"
>
<ImageButton
android:id="@+id/die1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:adjustViewBounds="true"
android:layout_weight="1"
android:layout_margin="2dp"
android:scaleType="centerInside"
/>
<ImageButton
android:id="@+id/die2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:adjustViewBounds="true"
android:layout_weight="1"
android:layout_margin="2dp"
android:scaleType="centerInside"
/> .....
次のようになります。
私が含まれていない場合
android:layout_height="60dp"
次に、サイコロが歪んで次のようになります。
ただし、「60dp」の部分を残すと、タブレットデバイスまたは高解像度のものに表示しようとすると、次のようになるという問題が発生します。
どこが間違っているのですか?