Skip to content

Instantly share code, notes, and snippets.

@egomez99
Created May 3, 2012 21:13
Show Gist options
  • Save egomez99/2589557 to your computer and use it in GitHub Desktop.
Save egomez99/2589557 to your computer and use it in GitHub Desktop.
iOS: Navgroup Closing window
var win = Titanium.UI.createWindow();
var win1 = Titanium.UI.createWindow({
backgroundColor:"red",
title:"Red Window"
});
win1.addEventListener('click', function(){
nav.open(toolsWindow);
});
var nav = Titanium.UI.iPhone.createNavigationGroup({
window: win1
});
var toolsWindow = Ti.UI.createWindow({
title: 'Blue Window',
url: 'tools_window.js',
nav: nav,
exitOnClose: false,
backgroundColor: 'blue'
});
win.add(nav);
win.open();
var win = Ti.UI.currentWindow;
var button = Ti.UI.createButton({
title: 'close',
height: 40,
width: 300
});
button.addEventListener('click', function(e) {
Ti.API.info('clicked close');
win.nav.close(win);
});
win.add(button);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment