Where'd padding go, when setting background Drawable?

后端 未结 16 1344
攒了一身酷
攒了一身酷 2020-12-03 00:41

I have this issue on my EditText and Button views, where I have a nice padding for them to space away from the text, but when I change the backgrou

16条回答
  •  盖世英雄少女心
    2020-12-03 01:05

    Just to explain what's happening :

    It's actually a feature. Layout drawables you might use as backgrounds can define a padding this way :

    
        ...
    
    

    This padding will be set along with the new drawable background. When there's no padding, the default value is 0.

    More info from an email written by Romain Guy: https://www.mail-archive.com/android-developers@googlegroups.com/msg09595.html

提交回复
热议问题