Titanium Community Questions & Answer Archive

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

DefaultImage while loading ImageView

I've read the forums for using DefaultImage property to ImageView, but getting an error.

My code//

var bandImg = Titanium.UI.createImageView({

image: e.rowData.imgSrc,

defaultImage: '../images/loading.png',

width:300,

height:250,

top:10

});

when i run, no images show up and get the following error in the console:

<Error>: CGBitmapContextCreateImage: invalid context 0x0

I've tried using a JPGs/PNGs and moving the location around, still no luck.

Any ideas?

Thanks!

— asked July 10th 2010 by Riley Hamilton
  • context
  • defaultimage
  • error
  • imageview
  • invaild
1 Comment
  • FYI, i'm developing this for iPhone

    — commented July 10th 2010 by Riley Hamilton

1 Answer

  • Accepted Answer

    Riley,

    I'm having the same issue after upgraded to 1.3.2.

    In my case, which used to be working in a scrollerview gallery.

    .......
    var imgOption = {borderColor:'#444',borderWidth:4,height:40,width:60,defaultImage:'blah.png'};
    loop ->
    var img = Ti.UI.createImageView(imgOption);img.image=thumblist[i];
    

    now i have to defined it after the "image"

    var imgOption = {borderColor:'#444',borderWidth:4,height:40,width:60};
    Loop ->
    var img = Ti.UI.createImageView(imgOption);img.image=thumblist[i];img.defaultImage='blah.png';
    

    That doesn't make sense, as one scrollview click event trigger another imageview to display the bigger image and that was working despite the same sequence.

    i guess it's just one of many bugs in the 1.3.2? what a pain.

    — answered July 10th 2010 by Daniel Lim
    permalink
    1 Comment
    • Is this for Android Daniel?

      — commented July 10th 2010 by David Ashwood
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.