Bold words in a string of strings.xml in Android

前端 未结 9 2093
甜味超标
甜味超标 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 02:57

    You could basically use html tags in your string resource like:

    
        We are so glad to see you.
    
    

    And use Html.fromHtml or use spannable, check the link I posted.

    Old similar question: Is it possible to have multiple styles inside a TextView?

提交回复
热议问题