如何在单个文本视图中编写多行 [英] how to write multi line in single text view

查看:88
本文介绍了如何在单个文本视图中编写多行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨frnds

i想在单文本视图中编写多行文字怎么做?

谢谢你...

hi frnds
i want to write multiline text in single text view how it is done ??
thank u ...

推荐答案

在你的xml文件中,找到TextView元素



In your xml file, locate the TextView element

<textview>
    ...
    android:singleLine="false"
    android:minLines="1"
    ...
    />
</textview>



这会将最小行数设置为1,并标记textview不是单行。要设置最大行数,请使用 android:maxLines 并使用 android:lines TextView 元素的属性。



PS

如果你发现这个有用,或者,如果它可以帮助您实现目标,请考虑将其标记为其他任何感兴趣的人接受的答案。


This will set the minimum number of lines to one, and also flag that the textview is not a single line. To set the maximum number of lines, use android:maxLines and for a specific number of lines, use android:lines attributes of the TextView element.

P.S
If you find this useful, or if it helps you meet your objective, consider to mark it as the accepted answer for anyone else interested.


请参阅http://developer.android.com/reference/android/widget/TextView.html [ ^ ]。


这篇关于如何在单个文本视图中编写多行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆