我在按钮中添加了一个名为“star”的图像,图片出现了,但它使按钮变大。将图像添加到按钮而不调整大小
<Button
android:id="@+id/latest_photoB"
android:layout_height="87dp"
android:layout_weight="1"
android:background="#dcdcdc"
android:drawableTop="@drawable/star"
android:text="Latest Photos"
android:textSize="10dp"
android:textColor="#000000" />
我尝试了许多不同的方法,例如使它成为imagebutton
。
我试过android:background = image
,但没有奏效。我如何添加图片并保持相同尺寸?
你想保持它与大小一样吗?如果你设置了背景,那么设置它应该保持这个尺寸的高度和宽度。 – Eluvatar