Given the following directory structure of your projects with the winBackground.png in the Resources/Images folder:
Setting the background of a window is pretty straightforward:
var shuffleWindow = Titanium.UI.createWindow({
title:'Shuffle',
backgroundImage:'images/winBackground.png'
});
I had some trouble getting the right image to load. I've seen instructions for the backgroundImage: '../images/winBackground.png' or '/images/winBackground.png' and was rather confused. If you see a black background it probably means the path to the image is wrong.
No comments:
Post a Comment