我想創建一個簡單的國旗遊戲。你會得到國家名稱,然後你必須猜出正確的標誌。在我的播放屏幕上,我有一個TextView和一個TableLayout,兩行中有4個圖像。這些圖像是相同的尺寸。TextView縮小TableLayout
問題是:TextView「縮小」了第二個TableRow,因此圖像不再是同樣大的。如果我刪除TextView,一切都很好。
我試圖在數字體系瀏覽器,它告訴我,第二的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>
你需要額外的信息嗎?
我不知道這種佈局的圖像可以做得更好嗎?
編輯: 的圖像是相當高的分辨率