Keep text in TextView with drawableLeft centered

后端 未结 21 1574
野的像风
野的像风 2021-02-03 17:10

In my app I have a header bar which consists of a single textview with fill_parent as width, which have a specific background color and some centered text. Now I want to add a d

21条回答
  •  我在风中等你
    2021-02-03 17:34

    Though fragile, you can avoid the use of a wrapper Layout by setting a negative padding on the drawable:

    
    

    You'll have to adjust the padding to the width of the drawable, but you're left with just a single TextView instead of an extra LinearLayout or etc.

提交回复
热议问题