How to align the text to top of TextView?

后端 未结 6 759
梦如初夏
梦如初夏 2020-12-04 16:58

How to align the text to top of a TextView?
Equivalent Android API for Swings setInsets()?
that is top of text should start be in (0,0) of TextView



        
6条回答
  •  渐次进展
    2020-12-04 17:12

    In your .xml, write that:

    android:gravity="center|top"
    

    The first "center" align your line horizontally in the center and the next "top" align vertically up.

提交回复
热议问题