Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating a multiline TextView

I have a TextView that should be 4 lines long .

First line text should be "YES"
Second Line ="No"
Third Line = "true"
Fourth line + "false"

How can this be done with a single TextView?

like image 922
Kumar Avatar asked Dec 01 '22 05:12

Kumar


1 Answers

try following for multiline TextView.

<TextView 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:maxLines="4" 
    android:singleLine="false" 
    android:text="YES\nNo\ntrue\nfalse" />

You can try \n to set text in next line.

like image 84
Ronak Mehta Avatar answered Dec 04 '22 20:12

Ronak Mehta