Hi,
I am stuck with a very basic problem. I am trying to insert an image into a window and it doesn't work.
My code is this:
var win = Ti.UI.createWindow({backgroundColor: '#ffffff'});
var wholeContent = Ti.UI.createImageView({
url: 'whole_con.jpg',
height: 'auto',
width: 'auto'
});
win.add(wholeContent); win.open();
'whole_con.jpg' is in the resources directory itself. Do you see any issues with it? However, I am not able to view it on the Android emulator. I did not test it with a device.
3 Answers
try
var wholeContent = Ti.UI.createImageView({ image: 'whole_con.jpg' });
Woa, an unexpected solution!!
I have made the before mentioned image in Adobe Photoshop. And then saved for the web. Now, I have opened it in IrfanView and saved as another jpeg picture. It worked when I used the new image. I am sure those headers Photoshop puts in your jpeg is not recognised by Titanium.
I was using Windows. Would love to know what happens in Mac
just save your image as a .png format you will get your solution
Your Answer
Think you can help? Login to answer this question!