Skip to content

Instantly share code, notes, and snippets.

@nuno
Last active August 29, 2015 14:03
Show Gist options
  • Save nuno/ad9a3a1aa5a5c247ccf4 to your computer and use it in GitHub Desktop.
Save nuno/ad9a3a1aa5a5c247ccf4 to your computer and use it in GitHub Desktop.
Titanium.UI.setBackgroundColor('#000');
// create tab group
var tabGroup = Titanium.UI.createTabGroup();
//
// create base UI tab and root window
var win1 = Titanium.UI.createWindow({
title:'Tab 1',
backgroundColor:'#fff'
});
var tab1 = Titanium.UI.createTab({
icon:'KS_nav_views.png',
title:'Tab 1',
window:win1
});
var label1 = Titanium.UI.createLabel({
color:'#999',
text:'Click to Toggle Slide In Menu',
font:{fontSize:20,fontFamily:'Helvetica Neue'},
textAlign:'center',
width:'auto'
});
win1.add(label1);
var bottomMenu = Ti.UI.createView({
width:'100%',
height:100,
bottom:-100,
backgroundColor:'#f44'
});
win1.add(bottomMenu);
label1.addEventListener('click', function(e){
// create variable to keep track of visibility
if (bottomMenu._up == true) {
bottomMenu.animate({bottom:-100,duration:500});
bottomMenu._up = false;
} else {
bottomMenu.animate({bottom:0,duration:500});
bottomMenu._up = true;
}
});
//
// add tabs
tabGroup.addTab(tab1);
// open tab group
tabGroup.open();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment