Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
var tabGroup = Ti.UI.createTabGroup();
var win1 = Ti.UI.createWindow({
title:"Test"
});
var win2 = Ti.UI.createWindow({
title:"Blank"
});
var tab1 = Ti.UI.createTab({
window:win1,
title:"Test"
});
var tab2 = Ti.UI.createTab({
window:win2,
title:"Blank"
});
tabGroup.addTab(tab1);
tabGroup.addTab(tab2);
var button = Ti.UI.createButton({
title:"Open",
width:80,
height:40
});
win1.add(button);
button.addEventListener('click',function()
{
try
{
// by default the modal window has a nav bar
// since we're embedding a navgroup inside the modal
// window which also has a nav bar, we ask him to hide it
var modal = Ti.UI.createWindow({
navBarHidden:true
});
var modalWin = Ti.UI.createWindow({
backgroundColor:"red"
});
var table = Ti.UI.createTableView({
style:Ti.UI.iPhone.TableViewStyle.GROUPED,
data:[{title:"Well look at this"},{title:"TweetDeck is cool"}]
});
modalWin.add(table);
var done = Titanium.UI.createButton({
systemButton:Titanium.UI.iPhone.SystemButton.DONE
});
modalWin.setRightNavButton(done);
done.addEventListener('click',function()
{
modal.close();
});
var nav = Ti.UI.iPhone.createNavigationGroup({
window:modalWin
});
table.addEventListener('click',function(e)
{
var w = Ti.UI.createWindow({
title:e.rowData.title
});
nav.open(w);
});
modal.add(nav);
modal.open({modal:true});
}
catch (E)
{
Ti.API.error("ERROR " +E);
}
});
tabGroup.open();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.