NappAppearance
NappAppearance copied to clipboard
Globally Set NavBarColor in function
Hi, I was wondering, is there an easy way to globally set the Navigation Bar barColor and/or tintColor in a function?
Example:
button.addEventListener('click', function() {
NappAppearance.setGlobalStyling({
navBar: {
barColor:'#ff0000',
tintColor:'#ffffff'
}
});
});
In your Ti app, using the CommonJS convention, all your windows should basically inherit basic properties from the same "win.js" file. So, something like this in your win.js file
module.exports = function(title) {
return Ti.UI.createWindow({
barColor: "#ff0000",
tintColor: "white",
title: title
});
});
and then where ever you need a need a window, you can simply do:
var newWin = require('win')("Photo Gallery");
//If you need to change the bar color?
newWin.barColor = "#00ff00";
newWin.open()