Image unable to display (Android)

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

I have following code

Titanium.UI.setBackgroundColor('#FFFFFF');
 
var homeWindow = Titanium.UI.createWindow({
    backgroundImage: 'HomeBg.png',
    exitOnClose: true
});
 
var view1 = Titanium.UI.createView({
    backgroundColor: 'red',
    height: '50%',
    width: '55%',
    top: 'true',
    left: 'true'
})
 
homeWindow.add(view1);
 
var view5 = Titanium.UI.createView({
    backgroundColor: 'black',
    height: '50%',
    width: '50%',
    bottom: 'true',
    right: 'true'
})
 
var bookImage = Titanium.UI.createImageView({
    url:'Book_icon.png'
    // image:'Book_icon.png' Also not working
});
 
view5.add(bookImage);
 
view1.add(view5);
 
homeWindow.open();
This code is not displaying the image in Image View.

Background Image is showing properly. And there is also Book_icon.png with the HomeBg.png.

I have tried with image as well. that is also not working.

— asked 2 years ago by AvtarSingh Suchariya
1 Comment
  • i am having the same problem, dont know why they imageView doesnt work

    — commented 2 years ago by Joseph Hampel

3 Answers

If you are devloping on windows - turn off fast dev and it will show.

— answered 2 years ago by Steve Hovey
answer permalink
2 Comments
  • How to turn off fast dev ???

    — commented 2 years ago by AvtarSingh Suchariya

  • Great tip, I was running in Android emulator on Windows and no images would show up, even though they show up fine on device or in OSX Android emulator. Turns out fast dev was the issue, disabling it caused images to show:

    <property name="ti.android.fastdev" type="bool">false</property>

    — commented 2 years ago by Justin Toth

http://developer.appcelerator.com/question/120444/how-to-disable-fastdev

turning it off worked for me as well

Why position properties (top, bottom, left, right) are set to string "true"? They should be string/float/integer number (42, '11%', ...) and not true or false (not even string "true" or "false").

Your Answer

Think you can help? Login to answer this question!