Adjusting the size of an ImageButton in Android

前端 未结 6 785
-上瘾入骨i
-上瘾入骨i 2020-12-29 07:14

Is there any way to do this? I have tried padding the image and setting the width/height of the view, but neither seems to work. Here is an example:



        
6条回答
  •  旧时难觅i
    2020-12-29 07:44

    Set android:background instead of android:src to set the image on the button. This will adjust the image to your button's size. Then adjust the padding after.

提交回复
热议问题