A NavigationWindow implements a specialized view that manages the navigation of hierarchical content. You call the NavigationWindow object's openWindow() method to open a open a new window in the navigation group, closeWindow() to remove it.
The sample's main index.xml view declares a NavigationWindow element named
<Alloy> <NavigationWindow> <Window id="main" title="Main Window"> <Label class="space">Click the button below to "push" a new window onto the navigation stack</Label> <Button class="space" onClick="Alloy.Globals.openWindow">push</Button> </Window> </NavigationWindow> </Alloy>
As of Titanium 8.0.0, you don't need to specify the platform type (e.g.
When the "Push" button is clicked, it invokes the
Alloy.Globals.openWindow() function. This function is defined in defined in the application's alloy.js file, and calls the
navWindow's openWindow() method, passing it a new window created from the
app/views/win.xml view. It also initializes a global counter variable named
ctr that's displayed by each window added to the navigation stack.