简体   繁体   English

如何在阅读视图中打开Web视图? UWP

[英]How to open a webview in reading view ? UWP

I have a FeedReader app and I would like my pages open in reading view ( feature from IE 11 , EDGE ) .as an example The news app in windows 10 uses this feature and all news descriptions are in reading view . 我有一个FeedReader应用程序,我希望在阅读视图中打开页面(来自IE 11,EDGE的功能)。作为示例,Windows 10中的新闻应用程序使用此功能,所有新闻描述都在阅读视图中。 is it possible ? 可能吗 ?

Reading View example (Screenshot) : 阅读视图示例(屏幕截图):

https://social.msdn.microsoft.com/Forums/getfile/733596 https://social.msdn.microsoft.com/Forums/getfile/733596

News app reading view example (Screenshot) : 新闻应用阅读视图示例(屏幕截图):

https://social.msdn.microsoft.com/Forums/getfile/733599 https://social.msdn.microsoft.com/Forums/getfile/733599

Thanks in advance . 提前致谢 。

In these cases the content of the web page is extracted and shown with custom styling. 在这些情况下,将提取网页内容并以自定义样式显示。

To get the same result you can use something like DIFFBOT (which I think is used in the News app) or Embedly which is cheaper, and get the content parsed and returned nice and structured. 为了获得相同的结果,您可以使用便宜的DIFFBOT (我认为是在News应用程序中使用)或Embedly之类的东西 ,然后将内容进行解析并返回精美且结构化的内容。 After that you'll have to style it yourself. 之后,您必须自己设置样式。

You can style it by "converting" it from HTML and show it in a TextBlock , or you can show it in a WebView . 您可以通过从HTML“转换”它并在TextBlock显示它来设置它的样式,也可以在WebView显示它。

EDIT: 编辑:
You can use something like HtmlUtilities.ConvertToText to get the text from the HTML. 您可以使用HtmlUtilities.ConvertToText之类的东西从HTML中获取文本。 I think you can convert one section at a time, that way you can style headers and such. 我认为您可以一次转换一个部分,这样就可以设置标题等样式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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