Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Phonegap on WP7 does not load images

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.

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;" />

And I get:

enter image description here

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

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.

like image 819
Mark Henderson Avatar asked Jan 17 '12 22:01

Mark Henderson


1 Answers

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

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.

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.

like image 176
Chris Sainty Avatar answered Oct 30 '22 06:10

Chris Sainty