2012-05-30 55 views
3

我有一个TextView应该是4行长。创建一个多行TextView

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

这怎么能用一个TextView来完成?

+1

首先发布您的代码你尝试过什么 –

+0

家伙如果我的回答是有帮助的ü那么在哪里投了 –

回答

17

尝试。

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

您可以尝试\n在下一行设置文本。

+0

TY ..我被T :-) – Kumar

+0

耶说没有probs –

+0

我可以让它多行,但是秀4行,如果溢出,显示滚动或向上/向下滑动? – khunshan

2

试试这个:以下为的TextView

<TextView android:id="@+id/text" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:lines="4" 
    android:text="YES\nNo\ntrue\nfalse" />