2012-03-27 85 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