Bold words in a string of strings.xml in Android

前端 未结 9 2098
甜味超标
甜味超标 2020-12-01 02:44

I have a long text in one of the strings at strings.xml. I want to make bold and change the color of some words in that text.

How can I do it?

9条回答
  •  遥遥无期
    2020-12-01 03:14

    Strings.xml

    Your text]]>
    

    To set

    textView.setText(Html.fromHtml(getString(R.string.activity_completed_text)));
    

提交回复
热议问题