其中HTML标记的Andr​​oid TextView的支持?标记、HTML、Andr、TextView

由网友(时间久了)分享简介:Android的TextView的类可以通过HTML.fromHtml显示格式文本()按如下说明,例如:的 HTML标签的字符串的TextView Android's TextView class can display formatted text via HTML.fromHtml() as explaine...

Android的TextView的类可以通过HTML.fromHtml显示格式文本()按如下说明,例如:的 HTML标签的字符串的TextView

Android's TextView class can display formatted text via HTML.fromHtml() as explained for example here: HTML tags in string for TextView

TextView的类只能处理HTML的一小部分,但我不知道哪些标记和属性都支持的,哪些不是。这里给出的总结:http://commonsware.com/blog/Android/2010/05/26/html-tags-supported-by-textview.html似乎不正确。例如。 < D​​IV ALIGN =" ...">我使用的是不工作的Andr​​oid 2.2

The TextView class can only deal with a small subset of HTML, but I do not know which tags and attributes are supported and which are not. The summary given here: http://commonsware.com/blog/Android/2010/05/26/html-tags-supported-by-textview.html does not seem to be correct. E.g. <div align="..."> does NOT work for me using Android 2.2

推荐答案

我注意到这篇文章:

http://daniel-$c$cs.blogspot.com/2011/04/html-in-textviews.html

列表&LT; D​​IV&GT;如通过Htm​​l.fromHtml()被支撑,但它并不显示为校准属性的支持。

lists <div> as being supported by Html.fromHtml(), but it doesn't show support for the "align" attribute.

(其它支持的属性显示为标签的页面上。)

(Other supported attributes are shown for tags on that page.)

笔者说,他通过在Git代码库望着code为Android构建的参考。

The author says he constructed the reference by looking at code in the git repositories for Android.

阅读全文

相关推荐

最新文章