【发布时间】:2012-11-04 12:08:31
【问题描述】:
图片:www.gunzhaxplz.com/xmlAndroid.png my problem http://gunzhaxplz.com/xmlAndroid.png
前言:我正在制作一个需要在一个表格行上有 6 个图像的应用程序。
问题:我似乎无法调整大小的图像,右侧的最后一张图像超出了屏幕
这里是 XML:
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/TableLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<TableRow
android:id="@+id/tableRow1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<ImageButton
android:id="@+id/imageButton1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/golem_square" />
<ImageButton
android:id="@+id/imageButton2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/lizard_square" />
<ImageButton
android:id="@+id/imageButton3"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:src="@drawable/baron_square" />
<ImageButton
android:id="@+id/imageButton4"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/dragon_square" />
</TableRow>
<TableRow
android:id="@+id/tableRow2"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<ImageButton
android:id="@+id/ImageButton03"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/golem_square" />
<ImageButton
android:id="@+id/ImageButton01"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/lizard_square" />
<ImageButton
android:id="@+id/ImageButton02"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:src="@drawable/baron_square" />
<ImageButton
android:id="@+id/ImageButton04"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/dragon_square" />
</TableRow>
【问题讨论】: