创建多行 TextView [英] Creating a multiline TextView
本文介绍了创建多行 TextView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个 TextView
应该有 4 行长.
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"
如何使用单个 TextView
完成此操作?
How can this be done with a single TextView
?
推荐答案
尝试关注 multiline TextView.
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" />
您可以尝试 \n
设置下一行文本.
You can try \n
to set text in next line.
这篇关于创建多行 TextView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文