【发布时间】:2021-07-27 13:55:39
【问题描述】:
我想显示 HTML
"<html><body><font color=\"black\">
In the name of <font color=\"blue\"><b> God</b></font>
the compassionate, the merciful</font></body><html>"
在文本视图中。所以我用了Html.fromHtml(),但是输出和浏览器不同。
不同的是,“上帝”这个词在 TextView 中不会以蓝色出现。
代码:
textView.setText("<html><body><font color=\"black\">
In the name of <font color=\"blue\"><b> God</b></font>
the compassionate, the merciful</font></body><html>");
【问题讨论】:
-
另外如果你有浏览器不同的截图,请分享
-
如果可能的话,还有移动和浏览器输出的屏幕截图。
-
字体已被废弃。使用跨度