Is it possible to set multiple styles for different pieces of text inside a TextView?
For instance, I am setting the text as follows:
tv.setText(line
The list of supported tags is:
If you use a string resource, you can add some simple styling, such as bold or italic using HTML notation. The currently supported tags are:
B
(bold),I
(italic),U
(underline),TT
(monospace),BIG
,SMALL
,SUP
(superscript),SUB
(subscript), andSTRIKE
(strikethrough). So, for example, inres/values/strings.xml
you could declare this:
We are so glad to see you.
(From http://developer.android.com/guide/faq/commontasks.html#selectingtext — Web Archive link,
typo is in original!)
It also shows that Html.fromHtml
isn't really needed in simple cases.