开发者

New line after space

开发者 https://www.devze.com 2023-02-10 07:20 出处:网络
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 mod

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

精彩评论

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