Android TextView Text not getting wrapped

前端 未结 24 1698
时光说笑
时光说笑 2020-11-27 02:51

Can anyone tell me what\'s going wrong with the text? Text longer than one line doesn\'t wrap to the next line but goes beyond the screen.

Following is the code:

24条回答
  •  醉话见心
    2020-11-27 03:27

    I put this attribute:

    android:inputType="textMultiLine"
    

    into my TextView and it has wrapping line and user can "Enter" for a new line.

    ============================================================

    When you come to this post, you may want to create a Big TextView which can display multiple lines so these attributes may also needed

    android:layout_height="Xdp" //where X is a number depends on how big Textview you want
    android:gravity="top" //in order to make your text start from the top of your TextView.
    

提交回复
热议问题