我想设计一个TableLayout,里面有一些带有图标和文本的大按钮。我找到了一些类似的问题,但不是完全相同的 1。我的简化XML布局如下:
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TableRow android:id="@+id/TableRow01" android:gravity="center">
<Button android:text="@string/telephone" android:drawableTop="@drawable/phone" android:id="@+id/button_phone"></Button>
<Button android:text="@string/help" android:src="@drawable/help" android:id="@+id/button_help"></Button>
</TableRow>
</TableLayout>
图标图片有点大,我希望Android可以将它们调整大小,但是android:height参数会调整按钮的大小,而不是嵌入图像的大小。你有什么办法可以让一个带有文本和图像的按钮“可调整大小”吗?