Background defaults to black
I've tried setting a background image using
Titanium.UI.setBackgroundImage('background.jpg');
and
var index = Ti.UI.createWindow({
backgroundImage:'background.jpg'
})
However for some strange reason it defaults to a blackscreen. Even if I attempt to take a step back and change the color to #fff the background is still black…
1 Answer
-
Accepted Answer
If you are trying to set the background of the main window of the app you must first get the window context by using win = Titanium.UI.currentWindow or if you are using the tabGroup win = Titanium.UI.currentTab. Then you can set the background color using win.backgroundColor = #fff or win.backgroundImage.