Images in app not displaying on device

You must Login before you can answer or comment on any questions.

The images in the app are displaying fine in the simulator, but not on the device.

Any suggestions??

— asked 11 months ago by Donal Lynch
1 Comment
  • All images are located in the "resources/iphone" folder. Do you use absolute or relative linking? Thanks;)

    — commented 11 months ago by Donal Lynch

1 Answer

Accepted Answer

My advice is to always use absolute paths to everything in Titanium, whether you are referring to a javascript file or an image file. This will help prevent cross-platform issues.

If your image file is in Resources/images/foo.jpg, refer to it as "/images/foo.jpg" within your code. If you need an iphone-specific override, put it in Resources/iphone/images/foo.jpg. You will still reference it as "/images/foo.jpg" in your code.

— answered 11 months ago by Jason Priebe
answer permalink
3 Comments
  • Ok thanks!! But I just cant seem to make ANY images appear on the actual device... When I say "/images/image1.png" - nothing appears on the phone, and nothing appears on the simulator. When I say "image1.png" - it appears on the simulator, but not on the phone..

    — commented 11 months ago by Donal Lynch

  • I can't explain that. It should work. I use "/images/xyz.png" throughout my application, and it works on android and ios devices, the android emulator, and the iphone simulator.

    Here's a thought -- are you running into a case sensitivity problem? I believe the iOS simulator is case-insensitive, but the actual device is case-sensitive. That's caused me some heartburn...

    If that's not it, maybe try cleaning your project?

    — commented 11 months ago by Jason Priebe

  • Yeah thanks, it was indeed a case-sensitivity problem;) Lesson learned...

    — commented 11 months ago by Donal Lynch

Your Answer

Think you can help? Login to answer this question!