Padding not working on ImageButton

后端 未结 3 1837
独厮守ぢ
独厮守ぢ 2020-12-13 17:03

In an app I am working on, I have several ImageButtons. Each ImageButton has a background and content in the form of a drawable. Right now the drawable is at maximum size wi

3条回答
  •  粉色の甜心
    2020-12-13 17:46

    You have to add to Your ImageButton definition

    android:scaleType="fitCenter"
    

    or other scaleType like fitXY, because by default image try to scale as much as possible and ignore padding

提交回复
热议问题