android: string format specify bold

后端 未结 7 676
半阙折子戏
半阙折子戏 2021-01-05 05:05

I have a string defined in string.xml like

Title: %1$s 

which is formatted us

7条回答
  •  无人及你
    2021-01-05 05:51

    You can do it like,

    textView.setText(Html.fromHtml("Title: Text"));
    

    If you have text in dynamic way..

    And to define formatings in Strings.xml you can do like,

    This text uses bold and italics 
    by using inline tags such as  within the string file.
    

    see This Link

提交回复
热议问题