Setting a main background image for an iPhone App
I would like to set a main background image for my entire application.
Is there a property where I can set this?
Right now, I'm setting it for each specific window, and when I transition from one window to the next - it slides.
2 Answers
-
Accepted Answer
Hi Marshall,
In my app.js I have,
Titanium.UI.setBackgroundColor('#000'); Titanium.UI.setBackgroundImage('graphics/bg.png');
In my current app I have a TabGroup with a single Tab to load the Windows so I get the NavBar and slide animation but I think it would work if your app was structured as just a series of windows you self manage.
You don't need to specify anything at Window creation to keep the transparency of the window.
While its not required I included the first line in the above code because you can also use the alpha of the PNG if you wanted to mix things up a bit. As a test change #000 to #0f0 and place an image with alpa in to see the background color (ps. I don't recommend using #0f0 for a production release).
Cheers,
Shane… -
Choose a background image for each Window in app.js
and
any other new window, set background color to 'transparent'.