0

I'm trying to display HTML content in a native page. I'm successfully parsing the HTML content and showing it in a Textview. But, Most of HTML styles are not applied to the Textview. For example:

<p style=\" color:#c9c8cd; font-family:Arial,sans-serif; font-size:14px; line-height:17px; margin-bottom:0; margin-top:8px; overflow:hidden; padding:8px 0 7px; text-align:center; text-overflow:ellipsis; white-space:nowrap;\">

Here color, font-amily, font-size and some other attributes are not working.

I used Html.fromHtml(html) method for setting the html content. Is there a way to extend HTML class and add these styles to it?

Is there any other alternatives.

pnuts
  • 58,317
  • 11
  • 87
  • 139
Sangeetha Pinto
  • 1,022
  • 3
  • 14
  • 32

1 Answers1

0

Here is the example:

myView.setHint(Html.fromHtml("<small><small><small>" + 
     getString(R.string.hint) + "</small></small></small>"));

More detail from here : http://commonsware.com/blog/Android/2010/05/26/html-tags-supported-by-textview.html

Akber
  • 521
  • 4
  • 10