简体   繁体   English

Windows Phone 7不显示脚本或图像

[英]Windows Phone 7 dont show scripts or images

I had a html website that I ported to android using a WebView for a quick demo. 我有一个HTML网站,已使用WebView移植到android进行了快速演示。 Almost all I had to do was to load the Index.html and set some properties to true. 我几乎要做的就是加载Index.html并将某些属性设置为true。 But now I have to do the same thing with Windows Phone and I cant get the web to work. 但是现在我必须对Windows Phone做同样的事情,但我无法使网络正常工作。

I´ll explain that I have an assets folder with the html and another folder with the images, and js inside. 我将解释说,我有一个带html的素材资源文件夹,另一个带图像和js的文件夹。

When i run the application I get the first Html page with plain text and the navigation to the other pages only display the titles. 当我运行该应用程序时,我得到了带有纯文本的第一个Html页面,而导航到其他页面仅显示标题。

I made some research and found about the Isolated storage but i dont know if has something to do with my solution. 我进行了一些研究,找到了有关隔离存储的信息,但我不知道我的解决方案是否与之有关。 This is my code: 这是我的代码:

    private void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e)
    {
        webBrowserUnico.IsScriptEnabled = true;
        webBrowserUnico.IsGeolocationEnabled = true;
        var rs = Application.GetResourceStream(new Uri("assets/Carrusel/memoria.html", UriKind.Relative));
        using (StreamReader sr = new StreamReader(rs.Stream))
        {
            this.webBrowserUnico.NavigateToString(sr.ReadToEnd());
        }
    }
}

I needed to store all my 500 images and js in the Isolated Storage and I had to change the Build Action of the images to Content. 我需要将所有500个图像和js存储在独立存储中,并且必须将图像的构建操作更改为内容。 The methods to introduce my files into the isolated storage can be found in http://transoceanic.blogspot.com.es/2011/07/wp7-load-local-html-files-and-all.html 可以在http://transoceanic.blogspot.com.es/2011/07/wp7-load-local-html-files-and-all.html中找到将我的文件引入隔离存储的方法。

In that website there is also a template that you can use to get all the files on your folder instead of writing all of them. 在该网站中,还有一个模板,您可以使用它来获取文件夹中的所有文件,而不用编写所有文件。

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

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