View backgroundImage
For some reason, I can not set a background image for a view? The path is correct and the code is correct. I can load that image using the imageview but the image will not load when using it in a backgroundimage attribute for the view.
I copy the exact code from KitchenSink and change the url but still, it failed.
var photo = Ti.UI.createView({
backgroundImage:'../images/custom_tableview/user.png',
top:5,
left:10,
width:50,
height:50
});
3 Answers
-
I have sometimes found if I change the path it works fine [follow example below]. No need to move any files, just edit the code:
'../images/custom_tableview/user.png'
to
'images/custom_tableview/user.png'
-
if you're really pressed put the image in the same directory (yes I know it's not totally cool) and use "user.png"
-
I have the same problem, none of the above solutions work, one of them (put in same) leads to crasch.. =/