我有一个字符串数组:
String[] articles = getArticles();
// articles[0] = "1. With the mixtures<br />2. Colors and others<br />";
// articles[1] = "3. Categories and people<br />4. Health and fitness";
StringBuilder sb = new StringBuilder();
for (String text : articles) {
sb.append(text);
}
String content = sb.toString();
Spanned spanned = Html.fromHtml(content);
textView.setText(spanned);
问题在于textView
我正在获取HTML标记,而不是应用换行符。
1. With the mixtures<br />2. Colors and others<br />3. Categories and people<br />4. Health and fitness
答案 0 :(得分:0)
articles[0] = "1. With the mixtures<<br />2. Colors and others<<br />";
// articles[1] = "3. Categories and people<<br />4. Health and fitness";