How can I stretch the image in imagebutton to the whole area of the imagebutton?

前端 未结 7 1048
感情败类
感情败类 2021-02-01 18:09

Here is a picture that will help you understand my problem:

\"It's

I want to stretch

7条回答
  •  感动是毒
    2021-02-01 18:56

    ImageButton is ImageView.
    If you want your image to fill button
    than set android:scaleType="fitXY", so the image you set in android:src will be stretched to fill whole image button.

    ImageButton has a background under your image and padding.
    If you do not want background
    set android:background="@android:color/transparent".
    If you do not want padding
    set android:padding="0" or set background without padding.

提交回复
热议问题