簡體   English   中英

去除android studio中jpg圖片按鈕周圍的空白

[英]Remove the white space around the jpg image button in android studio

我正在嘗試設置圖像按鈕。 但是當我在 android 工作室上使用它時,它有空白區域並且周圍有粗灰色邊框。(在照片 apk 中查看時不可見)。 我使用android:adjustViewBounds="true"屬性,但它不起作用。 如何刪除邊框和空白? (使用 android studio 或其他 apk)

圖像按鈕的代碼:

<ImageButton
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentEnd="true"
        android:layout_alignParentBottom="true"
        android:adjustViewBounds="true"
        android:src="@drawable/add_button" />

這是它在 android 工作室/手機上的樣子:

在此處輸入圖像描述

這就是它在照片 apk(windows) 中的外觀:[在此處輸入圖像描述 ]2]

那是一個圖像按鈕。 這是一個帶有圖像的按鈕。 灰色邊框是按鈕。 如果您不想要那個並且只想要一個可點擊的圖像,請使用 ImageView 而不是 ImageButton

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM