Keep text in TextView with drawableLeft centered

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

    the best way is to use ConstraintLayout, to make the textview at the center of the layout and the width warp_content(don't use 0dp now) so that the drawable will follow the text.

    
    

提交回复
热议问题