Wednesday, 14 June 2017

android - Can underline words in TextView text




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 ?


Answer



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



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

No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...