WP7 中 Android 的 Html.fromHtml() 相当于什么?
有没有一种快速而肮脏的方法可以以类似于 Android 的 Html.fromHtml() 的方式在文本块中呈现 HTML?我知道如何使用 HtmlAgilityPack 之类的东西手动解析它,但我真正想要的只是让它像文本块中的源一样呈现。
如果不是天真地那么也许使用某种自定义控件,不,我不想将其呈现为网页。
Is there a quick and dirty way to render HTML in a textblock in a fashion similar to Android's Html.fromHtml()
? I am aware of how to manually parse it with something like the HtmlAgilityPack, but all I really want is for it to render like its source in the textblock.
If not naively then perhaps with a custom control of some sort and, no I don't want to render it as a web page.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,抱歉花了这么长时间。我几乎忘记了如何正确使用 git,直到现在都没有时间上传。这个 HtmlTextBlock 提供了与其 silverlight 对应项类似级别的功能,与 android 的对应项非常接近。在处理更复杂的标签(如 html dtd 标签)时,它有时仍然有点问题,但确实可以完成工作......
WP7 Html 文本块。该设计很大程度上基于这个人的 将一点 html 引入到 silverlight-htmltextblock 中,使丰富的文本显示变得容易。并使用 html 敏捷性重写与 Web 浏览器相关的类。有一天我会发布详细信息,但是,等等……不是现在。哈哈
更新
使用示例:
注意:您的 html 必须进行转义,使得 < = <和>=>
详细用法请参见:
https://github.com/musicm122 /WP7HtmlTextBlock-/blob/master/HtmlTextBlockTest/HtmlTextBlockTest/MainPage.xaml
Ok sorry it took so long. I all but forgot how to use git correctly and hadn't had the time to upload till now. This HtmlTextBlock offers a similar level of functionality as to that of its silverlight counterpart which is pretty close to the android equivalent. Its still a bit buggy at times when dealing with more complex tags like the html dtd tag but does the job....
WP7 Html Text Block. The design is largely based on this guy's Bringing-a-bit-of-html-to-silverlight-htmltextblock-makes-rich-text-display-easy. and rewriting the web browser related classes using html agility. One day I'll post the details but, blah... Not right now. lol
Update
Example of usage:
Note: Your html will have to be escaped such that < = < and > = >
For detailed usage see:
https://github.com/musicm122/WP7HtmlTextBlock-/blob/master/HtmlTextBlockTest/HtmlTextBlockTest/MainPage.xaml