Mik378
Mik378

Reputation: 22191

Phonegap-Cordova / Why doesn't my image appear?

I have a cordova application (equivalent to phonegap) displaying an image like so:

<img src="../assets/images/logos/mylogo.png" alt ="" /> 

The arborescence uses by cordova is:

-index.html
-assets (has no parent folder)
--images
---logos
-----mylogo.png
-scripts
--1dc45af27.myapp.js //this is inside that my img src is declared

This works well on desktop, web mobile (yes my app works on every device), but not on the cordova app running on iOS.

Despite of the relative path, the image doesn't appear, just a square.

Any idea?

-----UPDATE I tried with the server on the port 8000 (cordova serve) and it well displays the logo when I use: ../assets/images/logos/mylogo.png, however on the iOS device, it doesn't show the logo...

it only works when I do:

src="file:///var/mobile/Applications/10434B65-E6C2-4442-9AFE-9ADE1A5A53E1/myApp.app/www/assets/images/logos/logo-wealcome.png"

Upvotes: 0

Views: 2647

Answers (1)

Aldous Gonda
Aldous Gonda

Reputation: 11

<img src="./assets/images/logos/mylogo.png" alt ="" />

remove a single "." on your src?

Upvotes: 1

Related Questions