WP7 上的 Phonegap 不加载图像 [英] Phonegap on WP7 does not load images

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

问题描述

我正在开始我的第一个 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 中引用还是在 标记中引用)总是出现损坏.

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/page/48672055/Getting%20Started%20with%20PhoneGap%20Windows%20Phone%207#4Reviewtheprojectstructure 第 4 部分.您应该将图像等的 Build Action 设置为Content 它只是在构建时将它们复制到输出项目中.它们当前可能设置为 ResourceNone.

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.

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

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