我有一個字符串,將被我的下一個類中的intentExtra拾取並設置爲多行TextView的文本。我是wodnering如果分割文本,以便他們下海誓山盟的方式,所以我有這個字符串:分割一個字符串,以便文本在彼此之間
maint = "Here is some info about nothing." +
"Some more info about nothing." +
"And a little more about nothing";
所以通常他們會像這樣顯示在一個TextView:
Here is some info about nothing. Some more info about nothing. And a little more info about nothing.
是有辦法,這樣他們就結束行之後的那些單獨的件中的每一個被寫入所述的TextView
像這樣:
Here is some info about nothing.
Some more info about nothing.
And a little more about nothing.
它似乎對於每個單獨的句子都有一個單獨的TextView太多了。
在此先感謝
好甜,謝謝,所以如果我只是使用'\ n'我不必解析? – 2012-02-09 18:52:06
@NickPesa是的,你不需要解析,如果你只是使用'\ n'。爲了供您參考,'\ n'是Java中的換行符。如果你想要更復雜的文本格式,比如不同顏色的文字,你可以使用HTML解析。 – onit 2012-02-09 18:53:37
工作完全謝謝 – 2012-02-09 18:53:56