Can underline words in TextView text

前端 未结 5 1579
野趣味
野趣味 2021-02-02 09:45

Is there possibility in android to provide TextView some text in Java code with setText(text) function with basic tags like and to make marked words underlined ?

5条回答
  •  感动是毒
    2021-02-02 10:30

    Yes, you can, use the Html.fromhtml() method:

    textView.setText(Html.fromHtml("this is underlined text"));
    

提交回复
热议问题