我有一個圖像(圖片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