Skip to content

Instantly share code, notes, and snippets.

@benbahrenburg
Created May 23, 2011 20:29
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save benbahrenburg/987529 to your computer and use it in GitHub Desktop.
Ti.App issues
// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#000');
var tzt ={
testIt: function(){
alert('testIt');
},
isAndroid : function(){
return (Ti.Platform.osname == 'android');
},
widthCalc : function(){
return (Ti.Platform.displayCaps.platformWidth>320) ? 320 : Ti.Platform.displayCaps.platformWidth;
}
};
Ti.App.tzt=tzt;
var tabGroup = Ti.UI.createTabGroup();
var wMain = Ti.UI.createWindow({
title:'Test',
backgroundColor:'#fff',
barColor:'#a32020',
tabBarHidden:true,
url:'page1.js'
});
var tab1 = Ti.UI.createTab({window:wMain});
tabGroup.addTab(tab1);
// open tab group
tabGroup.open();
var demo = {win : Ti.UI.currentWindow};
(function(){
alert(Ti.App.tzt.widthCalc());
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment