我有一个图像(图片1),它周围有一个透明区域,延伸到图像本身的上方和下方(图片2)。当我在xml中添加这个图像作为ImageButton
并使用wrap_content
时,图片2中的透明区域正在成为按钮的一部分,而不仅仅是按钮本身(图片1)。图3是结果。有谁知道如何解决这个问题?在ImageButton上显示透明图像背景
这里是我的XML:
<ImageButton
android:id="@+id/resume_button"
android:src="@drawable/disabled_resume_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/new_checklist"
android:layout_centerHorizontal="true"
/>
发表您的XML请 – Aakash
是你的图像保存为.png扩展名? – mubeen
@Aakash我在ImageButton中编辑了我的xml – Brejuro