【发布时间】:2014-08-30 02:45:47
【问题描述】:
我正在尝试将存储在 strings.xml 中的字符串中的特定单词加粗:
这是我想要的:
将来时:示例:我将在上午 9:00 到那里
我关注了这个:Bold words in a string of strings.xml in Android - 但没有得到结果。
所以我在 strings.xml 中有如下文本:
<string name="futureText">Future tense: <b>Example:</b> I will be there at 9:00AM</string>
Spanned text = Html.fromHtml(res.getString(R.string.futureText));
questionText.setText (text);
“示例:”我没有得到任何粗体。
另外如何将“示例:我将在上午 9:00 到”文本添加到下一行?我知道字符串 \n 转到下一个 html 格式怎么样?
这里有什么问题?
【问题讨论】: