如何在 Windows Phone 7.1 中制作黑色背景的 Webbrowser 控件 [英] How to make Webbrowser control with black background in Windows Phone 7.1

查看:17
本文介绍了如何在 Windows Phone 7.1 中制作黑色背景的 Webbrowser 控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 webbrowser 控件显示本地 html 内容,导致 html 页面的背景颜色为黑色.

I am using webbrowser control to show local html content, cause the the background-color of the html page is black.

当我使用 NavigateToString 方法导航到 webbrowser 时,webbrowser 的背景立即变为白色,当白色进入 html 页面后,背景变为黑色.

When I using NavigateToString method to navigate to the webbrowser, the webbrowser's background become white immediately, after a white coming the html page, then the background become black.

这有点令人不安.考虑提供最好的 UX,我想实现 webbrowser 的默认背景为黑色.

It's a little disturbing. Consider providing the best UX, I want to implement that the default background of the webbrowser is black.

提前谢谢.

推荐答案

不幸的是,这是 WebBrowser 控件的一个怪癖.我在使用 WP7 编写 PhoneGap 应用程序时发现了完全相同的问题.我想出的解决方案是创建一个覆盖 WebBrowser 控件的 UI 元素,等待内容被呈现,然后淡出并隐藏覆盖元素,如本博文中所述.

Unfortunately this is a quirk of the WebBrowser control. I discovered the exact same issue when writing PhoneGap applications with WP7. The solution I came up with was to create a UI element that covers the WebBrowser control, wait for the content to be rendered, then fade out and hide the covering element, as described in this blog post.

这篇关于如何在 Windows Phone 7.1 中制作黑色背景的 Webbrowser 控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆