Images not showing in PhoneGap Build application

微笑、不失礼 提交于 2019-12-01 04:01:06

I had a similar problem. My solution was to change image paths by removing the leading "/": /img/my_icon.png -> img/my_icon.png, then my in-app icons showed up. It looks like your paths are correct though.

I was able to fix it by just throwing the images into the root folder and linking to that. May not be the best solution but it works! Hope this helps any viewers. PhoneGap Build apps require the images to be in the root folder.

I had problems with file name case sensitivity, after changing all the image file names to lower case, and referring the same by the same casing, everything started working fine.

I found that both the other answers are correct. At least for me, the images must be in the root folder and the case in the HTML must match the actual image file name case.

I'm using Nomad, so I don't know if this is a Nomad problem in packaging the app or a PhoneGap problem.

I had a problem with this when I was using media queries in CSS. I forgot to take into account that CSS image paths are relative to the stylesheet, not to the document. So in my case, my path became ../images/...

May be relevant to devs using gulp to build their applications: if images aren't showing up, check out where the images are being placed within www after a gulp build.

In my case PhoneGap was searching for images in /www/css folder. Changing the clean and images tasks to reflect that solved my issue.

I was attempting to set a background-image with CSS; it works now using:

background-image: url("img/background.jpg")
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!