开发者

New line after space

Is there a way to have a TextView that adds a new line after each space charact开发者_C百科er in the text? For example, the text "one two three" should be displayed on 3 lines.


Can't you modify the text before it's added to the ListView to translate whitespace to newline?

String text = "one two three";
text.replaceAll("\\s", "\n");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜