Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 267
user3860990 Avatar asked Feb 12 '23 10:02

user3860990


1 Answers

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

like image 80
Nishanthi Grashia Avatar answered Feb 15 '23 10:02

Nishanthi Grashia