1010 次
1 回答
2
好吧,简单地说,它不受支持。Html.fromHtml() 处理一组不同于静态文本支持的标记。这是标签列表(我不知道它是否完整):
<a> (supports attribute "href")
<b>
<big>
<blockquote>
<br>
<cite>
<dfn>
<div>
<em>
<font> (supports attributes "color" and "face")
<i>
<img> (supports attribute "src". Note: you have to include an ImageGetter to handle retrieving a Drawable for this tag)
<p>
<small>
<strong>
<sub>
<sup>
<tt>
<u>
您可以在此处查看源代码。
您必须使用具有扩展功能的库才能使其正常工作,或者自己编写一个。检查这个或这个。Github 上还有很多其他的,或者如果你想编写它,我相信你可以通过谷歌搜索找到代码。
于 2018-08-23T15:28:31.713 回答