PhoneGap在WP7不加载图像 [英] Phonegap on WP7 does not load images

查看:122
本文介绍了PhoneGap在WP7不加载图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始我的第一个PhoneGap项目,并开发使用Visual Studio和Windows Phone 7,虽然我打算最终部署到iOS和Symbian也。

I'm starting my first PhoneGap project and am developing using Visual Studio and Windows Phone 7, although I intend on ultimately deploying to iOS and Symbian as well.

但是,我坚持在第1步。我已经添加了一个图像到 www / images 文件夹,并添加以下代码:

However, I'm stuck at Step 1. I have added an image to the www/images folder, and put the following code:

<img src="images/login-btn.png" width="103" height="42" style="margin-left:90px;" />

我得到:

当我预览时效果很好在IE9中,但我没有Mac来测试它在iOS上。

It works fine when I preview it in IE9, but I don't have a Mac to test it on iOS yet.

这是值得注意的JS文件和CSS已加载好,它只是任何图像(无论在CSS或< img> 标记中引用)总是出现碎片。

It's worth noting that the JS files and CSS have loaded fine, it's just any image (whether referenced in CSS or an <img> tag) always comes up broken.

推荐答案

我的猜测是图片文件的 Build Action 不正确。

My guess would be the Build Action of your image file is incorrect.

http://wiki.phonegap.com/w/页面/ 48672055 /获取%20启动%20与%20PhoneGap%20Windows%20Phone%207#4Reviewtheprojectstructure 部分4.您应该设置构建操作内容,只需将它们构建时将其复制到输出项目中即可。它们可能当前设置为资源

According to http://wiki.phonegap.com/w/page/48672055/Getting%20Started%20with%20PhoneGap%20Windows%20Phone%207#4Reviewtheprojectstructure section 4. You should be setting the Build Action of your images etc to Content which simply copies them into the output project when it is built. They are probably currently set to Resource or None.

要更改 Build Action ,请右键单击文件,如果您尚未打开文件,选择属性以转到属性窗口。它可能是第一个属性。只需点击并选择正确的。

To change the Build Action right click a file and choose properties to go to the properties window if you do not already have it open. It is probably then the first property. Just click and choose the correct one.

这篇关于PhoneGap在WP7不加载图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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