I try to display an HTML text with its styles, but the text is shown without styling.
In my code there are two numbers, one should be red and the other should be striped. In action, they both seems as simple text.
Here is my code:
String str = "<span>  <span dir=\"rtl\" style=\"text-align:right;color:#ff0000;\"> 20.00</span> <span dir=\"rtl\" style=\"text-align:right;text-decoration: line-through;\">26.99 </span></span>";
Spanned spanned = Html.fromHtml(str);
txtView.setText(spanned);
not all the html tags are supported ( take a look here)
In my experience I have seen worked only div and p...
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.