Android String Resource Superscript

前端 未结 5 1242
无人共我
无人共我 2020-12-06 22:25

I have a string resource file, which I want to pull strings from and I want one of the strings to have some superscript in it.

From http://developer.android.com/gui

5条回答
  •  佛祖请我去吃肉
    2020-12-06 23:07

    I am using this trick: In string resource:

    x!sup@2!/sup@
    

    Then in activity:

    text1.setText(Html.fromHtml(getString(R.string.text1).replace("!", "<").replace("@", ">")));
    

    this trick is working.

提交回复
热议问题