2012-03-27 83 views
2

在我的应用程序中,我使用长文本的文本视图。我需要像在Android模拟器 - >联系人 - >手机(联系人的拨号键盘屏幕短)的文字包装。如何在Android的文本视图中对长文本进行文本换行

enter image description here

但在我的应用程序得到文本换行如下图所示: enter image description here

我尝试了好几种方式不符合我的要求。 我不需要在文本视图右上角的“...”。而不是那个,我想包装文本在第一个图(android模拟器 - >联系人 - >电话)。怎么做?请帮帮我。提前致谢。

+0

看到这个拨号例子也许有帮助:简单的拨号应用(HTTP://eagle.phys。 utk.edu/guidry/android/simpleDialer.html) – 2012-03-27 08:14:23

回答

6

我想设置以下属性,您TextView的应该帮助你实现这一行为:

android:layout_width="fill_parent" 
android:layout_height="wrap_content" 
android:ellipsize="none" 
android:singleLine="false" 
+0

感谢它的工作。 – 2012-03-28 07:45:37

+5

如何将这些应用于动态创建的文本视图? – Orion 2014-03-21 00:22:11

+0

singleLine由于其默认值为false而不推荐使用 – Orri 2016-12-21 13:04:03