Hi,
I'm newbie with Appcelerator and so far, I'm pretty happy of what can be done with it.
Right now, I'm working on a quick test application. I have 5 tabs which all link to specific windows ... do not know if it's the right way to do it but is there any way to have a 'global' or unique titlebar that can be use for any windows?
Thanks
2 Answers
Accepted Answer
Hi Steve, if you are using 5 tabs, means you are using tab group and in that case you get inbuilt title bar in iPhone, if you set the Title Property of the window.... you just set the title property of the windows...
using the commonJS approach, I create building blocks to be used across the application.
DonationBar.js has a view that is positioned at the top of its parent, is white, has a 2 pixel high child view that is black.
DonationBar.js
var DonationBar = function(){ var self = Ti.UI.createView({ backgroundColor: 'white', width: Ti.UI.FILL, height: 52, top: 0 }); var header = Ti.UI.createView({ height: 2, width: Ti.UI.FILL, bottom: 0, backgroundColor: 'black' }); self.add(header); return self; }; module.exports = DonationBar;It can be added to any window as so:
var DonationBar = require('/ui/common/DonationBar'); var donationBar = new DonationBar(); self.add(donationBar); // self being your windowOne change in your DonationBar.js and its applied across all its locations in the app.
Your Answer
Think you can help? Login to answer this question!