シンプルなフラッグゲームを作りたいです。国名が与えられ、正しい国旗を推測する必要があります。私の再生画面には、TextView と TableLayout があり、2 行に 4 つの画像があります。これらの画像は同じ寸法です。
問題は次のとおりです。TextView が 2 番目の TableRow を「縮小」するため、画像が同じ大きさではなくなります。TextView を削除すると、すべて問題ありません。
Hierachy Viewer でデバッグしようとしましたが、2 番目の TableRow のプロパティ mMeasuredHeight の値が非常に高いことがわかりました (16777526)
私のプレイアクティビティxml:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="4dp"
tools:context=".PlayTimeModeActivity" >
<TextView
android:id="@+id/tvFlagName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:text="Hello"
android:textSize="50dp" />
<TableLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal" >
<TableRow>
<ImageView
android:id="@+id/ivFlag1"
android:layout_margin="4dp"
android:contentDescription="@string/cdFlag1" />
<ImageView
android:id="@+id/ivFlag2"
android:layout_margin="4dp"
android:contentDescription="@string/cdFlag2" />
</TableRow>
<TableRow>
<ImageView
android:id="@+id/ivFlag3"
android:layout_margin="4dp"
android:contentDescription="@string/cdFlag3" />
<ImageView
android:id="@+id/ivFlag4"
android:layout_margin="4dp"
android:contentDescription="@string/cdFlag4" />
</TableRow>
</TableLayout>
</LinearLayout>
追加情報が必要ですか?
この画像のレイアウトをもっとうまくできないだろうか?
編集:画像はかなり高解像度です