Skip to content

Instantly share code, notes, and snippets.

@euforic
Created October 22, 2012 06:10
Show Gist options
  • Save euforic/3929943 to your computer and use it in GitHub Desktop.
Save euforic/3929943 to your computer and use it in GitHub Desktop.
MVC Breakout - VIEW
// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#000');
// Module Exports
var self = module.export = {};
// create tab group
self.tabGroup = Titanium.UI.createTabGroup();
//
// create base UI tab and root window
//
self.win1 = Titanium.UI.createWindow({
title:'Tab 1',
backgroundColor:'#fff'
});
self.tab1 = Titanium.UI.createTab({
icon:'KS_nav_views.png',
title:'Tab 1',
window:self.win1
});
self.label1 = Titanium.UI.createLabel({
color:'#999',
text:'I am Window 1',
font:{fontSize:20,fontFamily:'Helvetica Neue'},
textAlign:'center',
width:'auto'
});
self.win1.add(self.label1);
//
// create controls tab and root window
//
self.win2 = Titanium.UI.createWindow({
title:'Tab 2',
backgroundColor:'#fff'
});
self.tab2 = Titanium.UI.createTab({
icon:'KS_nav_ui.png',
title:'Tab 2',
window:self.win2
});
self.label2 = Titanium.UI.createLabel({
color:'#999',
text:'I am Window 2',
font:{fontSize:20,fontFamily:'Helvetica Neue'},
textAlign:'center',
width:'auto'
});
self.win2.add(self.label2);
//
// add tabs
//
self.tabGroup.addTab(self.tab1);
self.tabGroup.addTab(self.tab2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment