Images aren't showing up. They just appear black
This is the code for my app:
// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#000');
// Home window
var win1=Titanium.UI.createWindow({
image:'images/mainpage-bg.png'
});
var btn=Titanium.UI.createButton({
backgroundImage:"images/Twitter.png",
width:60,
height:60
});
btn.addEventListener("click",function(e){
alert(e.source + "was clicked");
});
win1.open();
win1.add(btn);
It is a simple window(supposed to have a background) with a button that is also supposed to have a background. But there is nothing.
Any help would be greatly appreciated!
1 Answer
-
use
backgroundImage
for the window and follow the button skinning examples from the Kitchen Sink demo app for more guidance on how to use custom images.