我想显示HTML
"<html><body><font color=\"black\">
In the name of <font color=\"blue\"><b> God</b></font>
the compassionate, the merciful</font></body><html>"
Run Code Online (Sandbox Code Playgroud)
在TextView中.所以我使用过Html.fromHtml(),但与浏览器相比输出有所不同.
不同之处在于TextView中的"God"一词并未显示为蓝色.
码:
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>");
Run Code Online (Sandbox Code Playgroud)
Html.fromHtml(String)不支持所有 HTML 标签
允许的 HTML 标签列表: