简体   繁体   中英

HTML in WP7 without webbrowser control

Is there a control in WP7, other than a WebBrowser , which can display basic HTML (a few <p> s, <b> s, <i> s, <div> s and <span> s) inline?

I cannot use a WebBrowser for my app because I need the control to live inside a pivot (ie not swallow any gestures), and to keep the background of the rest of the pivot.

If it's basic markup you can always transform the HTML with the help of the HTML Agility Pack to a RichTextBox. (See: http://debugmode.net/2011/06/02/richtextbox-in-windows-phone-7-1-or-mango/ )

This is pretty simple to do with the WebBrowser control if you have a solid color background. Basically you have the WebBroswer adjust the background color of the HTML content, and disable hit testing to stop the control from eating your gestures.

Some code examples can be found in this article:

http://blogs.msdn.com/b/mikeormond/archive/2010/12/16/displaying-html-content-in-windows-phone-7.aspx

'Other' options for rendering HTML content in SL/WP7 tend to bite me in the rear in the long run.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM