/ Published in: JavaScript

Expand |
Embed | Plain Text
// this sets the background color of the master UIView (when there are no windows/tab groups on it) Titanium.UI.setBackgroundColor('#000'); Titanium.UI.iPhone.StatusBar.TRANSLUCENT_BLACK; // create tab group var tabGroup = Titanium.UI.createTabGroup(); // // create base UI tab and root window // var b1 = Titanium.UI.createButton({ title: 'Edit' }); var b2 = Titanium.UI.createButton({ systemButton:Titanium.UI.iPhone.SystemButton.ADD }) b2.addEventListener('click', function() { var w = Titanium.UI.createWindow({ //backgroundColor:'#336699', title:'Modal Window', //barColor:'black', url:'/timer/newtimer.js' }); var saveBtn = Titanium.UI.createButton({ title:'Save', style:Titanium.UI.iPhone.SystemButtonStyle.PLAIN }); w.setLeftNavButton(saveBtn); saveBtn.addEventListener('click',function() { w.close(); }); w.open({modal:true}); }) var win1 = Titanium.UI.createWindow({ //id: 'win1', backgroundColor:'#d2d2d2', title:'Timers', leftNavButton:b1, rightNavButton:b2 }); var tab1 = Titanium.UI.createTab({ icon:'KS_nav_views.png', title:'Timers', window:win1 }); var data = [{title:"Row 1"},{title:"Row 2"}]; var table = Titanium.UI.createTableView({data:data}); win1.add(table); // // create controls tab and root window // var win2 = Titanium.UI.createWindow({ title:'Settings', backgroundColor:'#fff' }); var tab2 = Titanium.UI.createTab({ icon:'KS_nav_ui.png', title:'Settings', window:win2 }); var label2 = Titanium.UI.createLabel({ color:'#999', text:'I am your dead dog, haunting you for not feeding me.', font:{fontSize:20,fontFamily:'Helvetica Neue'}, textAlign:'center', width:'auto' }); win2.add(label2); // // add tabs // tabGroup.addTab(tab1); tabGroup.addTab(tab2); // open tab group tabGroup.open();
You need to login to post a comment.