Windows phone 8.1 Windows Phone 8.1 webview未加载本地文件
我正在我的项目中使用webview。我想从本地加载一些css、js文件(例如jquery、bootstrap文件或custom..) 反正 这个代码就是我在示例中使用的Windows phone 8.1 Windows Phone 8.1 webview未加载本地文件,windows-phone-8.1,Windows Phone 8.1,我正在我的项目中使用webview。我想从本地加载一些css、js文件(例如jquery、bootstrap文件或custom..) 反正 这个代码就是我在示例中使用的 private async void NavigationHelper_LoadState(object sender, LoadStateEventArgs e) { webViewFormResponse.NavigateToString(" " + "<htm
private async void NavigationHelper_LoadState(object sender, LoadStateEventArgs e)
{
webViewFormResponse.NavigateToString(" " +
"<html><head><link rel='stylesheet' href='ms-appx-web:///css/mobileview.css' type='text/css' media='screen' /></head>" +
"<input type='text' value='testt'>" +
"</html>");
}
private async void NavigationHelper\u LoadState(对象发送方,LoadStateEventArgs e)
{
webViewFormResponse.NavigateToString(“”)+
"" +
"" +
"");
}
我正在使用ms appx web://,但未加载css。我怎么了?不能以这种方式使用NavigateToString。您必须使用WebView.NavigateToLocalStreamUri加载本地CSS。请参阅我的博客文章,了解有关这方面的一些好信息: