Android TextView 文字换行的问题

Android TextView 文字换行的问题

 Android TextView textView.setText("aaa\nbbb");可以自动换行,

但是String s = "aaa\nbbb";

textView.setText(s);

就不能正常换行了,

解决:

s = "aaa\nbbb";

s = s.replace("\\n", "\n");

textView.setText(s); 

正常了

你可能感兴趣的:(Android TextView 文字换行的问题)