Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/silverlight/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Webbrowser中以黑色背景显示Html格式的字符串_Html_Windows Phone 7_Windows Phone 8_Meta - Fatal编程技术网

在Webbrowser中以黑色背景显示Html格式的字符串

在Webbrowser中以黑色背景显示Html格式的字符串,html,windows-phone-7,windows-phone-8,meta,Html,Windows Phone 7,Windows Phone 8,Meta,我正在开发一个WindowsPhone8应用程序。在我的应用程序中,我使用WebBrowser控件来显示HTML格式的字符串。我需要显示黑色背景的html格式的文本。我做得很成功,但问题是 在WebBrowser中呈现html格式的字符串时,它首先显示白色,然后显示具有黑色背景的实际字符串。它看起来像是flick效果,然后显示我的html格式字符串 我使用的代码是: string html = ("<!DOCTYPE html5><html><head><

我正在开发一个WindowsPhone8应用程序。在我的应用程序中,我使用WebBrowser控件来显示HTML格式的字符串。我需要显示黑色背景的html格式的文本。我做得很成功,但问题是

在WebBrowser中呈现html格式的字符串时,它首先显示白色,然后显示具有黑色背景的实际字符串。它看起来像是flick效果,然后显示我的html格式字符串

我使用的代码是:

string html = ("<!DOCTYPE html5><html><head><meta name=\"viewport\" content=\"user-scalable=no background-color:black\" />" + sctipy + "</head><body style= \"background:#000; color:#fff;\"><div id=\"content\">" + myHtmlFormattedString + "</div></body>" + "</html>");
webbrowser.NavigateToString(html);
string html=(“+sctipy+”+myHtmlFormattedString++”);
webbrowser.NavigateToString(html);

是否有其他解决方案,如将WebBrowser控件的默认背景更改为非白色

问题在于无法更改WebBrowser控件本身的背景

我也有同样的问题。。。我通过使WebBrowserControl崩溃来解决这个问题,当WebBrowserControl的
LoadCompleted
点击时,使其可见

XAML:

这也使您能够在加载(巨大)页面时显示ProgressBar/ProgressRing并隐藏,直到触发
WebBrowser\u LoadCompleted
为止。当您加载一个小页面时,您将看不到可见/折叠部分的差异,您的闪烁问题也消失了

<phone:WebBrowser x:Name="browser" IsScriptEnabled="True" Visibility="Collapsed" LoadCompleted="WebBrowser_LoadCompleted" />
public void WebBrowser_LoadCompleted(object sender, EventArgs e);
{
   browser.Visibility = Visibility.Visible;
}