user3860990 user3860990 - 5 months ago 15
Android Question

How to format text in string displayed in TextView

I'm trying to format text in string, which is displyed in

TextView
.

<string name="register"> <p align="center"><u><b><i>Something</i></b></u></p>
<p align="right">Blablabla</p>


Underline, bolt and italics are working, but new paragraph and align isn't. Am I doing something wrong? Is there some other tag for end of a paragraph/new line?

Answer

Refer here http://bigknol.com/android-supported-html-tags-textview-string/

Not all html tags are supported in android. As per the link only the following tags are supported:

<big></big>
<small></small>
<bold></bold>
<strike></strike>
<a href=””></a>
<sup></sup>
<sub></sub>
<u></u>
<i></i>
<tt></tt>

Also refer here Which HTML tags are supported by Android TextView? Another reference is here http://javatechig.com/android/display-html-in-android-textview

Comments