Keep text in TextView with drawableLeft centered

后端 未结 21 1222
野的像风
野的像风 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:43

    drawable is part of the TextView, so the textview's height will be the drawable's height if your text's height is smaller than drawable's height.

    You can set TextView's gravity attribute to center_vertical, so the text will be in the center.

提交回复
热议问题