Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

webview and local images?

Is there some readon my logo.png should not be showing up in a webview? Everything else in the view works, and if I point the img src to a web-based image, it displays fine… but the logo file IS in the images folder (I've tried it in other too…), t DOES show up fine when tested with safari, it also DOES NOT work with different images in other formats (jpg, gif, etc)

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Technology Demo</title>
</head>
<body style="text-align: center">
<h1>Welcome to the demo page</h1>
<p><img src=" images/logo.png" alt="logo"></p>
<p>This is the main page of the app, where an explanationan, images and contact info could go…</p>
</body>
</html>

— asked April 1st 2010 by david hoare
0 Comments

5 Answers

  • Local image refs broke with the switch to 1.1

    I've posted a couple messages about this with no solutions.

    Emailed Appcelerator and the sales person basically told me I could get this fixed in no time if I just bought Premium support.

    So there you are…

    — answered April 1st 2010 by Eldon Benz
    permalink
    0 Comments
  • Does it make any difference if you try to reference your image like this?

    <img src="app://images/logo.png" alt="logo">
    
    — answered April 2nd 2010 by Dan Giulvezan
    permalink
    0 Comments
  • Put it in the main directory and it will work !

    — answered April 3rd 2010 by Johan Pyfferoen
    permalink
    0 Comments
  • I've finally gotten img references to work in 1.2

    Reference that works for me <img src="app://somefolder/myimage.jpeg" >

    in this somefolder is absolutely required it can be 'Resources' but I just added an 'images' folder to put them in.

    ie <img src="app://images/myimage.jpeg" >

    This <img src="app://myimage.jpeg" > will cause the app to crash when it loads the page.

    Haven't tested this on an actual phone yet.

    — answered April 6th 2010 by Eldon Benz
    permalink
    0 Comments
  • I've finally gotten img references to work in 1.2

    Reference that works for me <img src="app://somefolder/myimage.jpeg" >

    in this somefolder is absolutely required it can be 'Resources' but I just added an 'images' folder to put them in.

    ie <img src="app://images/myimage.jpeg" >

    This <img src="app://myimage.jpeg" > will cause the app to crash when it loads the page.

    Haven't tested this on an actual phone yet.

    — answered April 6th 2010 by Eldon Benz
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.