Reputation: 10012
Greetings,
I'm trying to simply display an image using Appcelerator on Android.
I don't understand why it won't work.
Here is my code:
var back=Titanium.UI.createImageView({
url:'images/back.png'
});
win.add(back);
I've also tried putting the image inside a view:
var view = Titanium.UI.createView({
borderRadius:10,
backgroundColor:'red',
left:10,
right:10
});
var back=Titanium.UI.createImageView({
url:'images/back.png'
});
view.add(back);
win.add(view);
I'm totally stuck and am hoping someone can point me in the right direction here.
Many thanks in advance,
Upvotes: 0
Views: 5721
Reputation: 10012
I got it working as follows:
var back_fn=Ti.Filesystem.getFile(Titanium.Filesystem.resourcesDirectory,'images/back.png');
var back=Titanium.UI.createImageView({
image:back_fn,
top:10,
right:10
});
win.add(back);
Thanks for all the responses guys,
Upvotes: 4
Reputation: 33335
try this
var back=Titanium.UI.createImageView({
url:'images/back.png',
height : 130,
width : 130
});
Upvotes: 0