Highlighting Text Color using Html.fromHtml() in Android?

后端 未结 9 1332
忘了有多久
忘了有多久 2020-11-28 19:26

I am developing an application in which there will be a search screen where user can search for specific keywords and that keyword should be highlighted. I have found Html.f

9条回答
  •  一整个雨季
    2020-11-28 20:23

    textview.setText(Html.fromHtml(""+text contain+""));
    

    It will give the color exactly what you have made in html editor , just set the textview and concat it with the textview value. Android does not support span color, change it to font color in editor and you are all set to go.

提交回复
热议问题