# Titanium.UI.iOS.NavigationWindow

> A `NavigationWindow` implements a specialized view that manages the navigation of hierarchical content.

- Source: https://titaniumsdk.com/docs/sdk/12.7.0/Titanium.UI.iOS.NavigationWindow
- Titanium SDK version: 12.7.0
- Kind: view
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK iPhone 3.1.3, iPad 3.1.3, macOS 9.2.0
- Extends: Titanium.UI.Window
- Inheritance: Titanium.UI.Window > Titanium.UI.View > Titanium.Proxy
- DEPRECATED since 8.0.0, removed in 10.0.0. Use [Titanium.UI.NavigationWindow](Titanium.UI.NavigationWindow) instead.

You create a `NavigationWindow` with the [Titanium.UI.iOS.createNavigationWindow](https://titaniumsdk.com/docs/sdk/Titanium.UI.iOS.md#createNavigationWindow) factory method, or
a `<NavigationWindow>` Alloy element.

All `NavigationWindow` objects must have at least one root window that cannot be removed. When
creating a `NavigationWindow` with the factory method, you must set its `window` property to the
root level window. Equivalently, in an Alloy application, insert a `<Window>` element as a child of the
`<NavigationWindow>` element. See examples below.

This object is not meant to be added to other windows. However, it can be used within a [Titanium.UI.iOS.SplitWindow](https://titaniumsdk.com/docs/sdk/Titanium.UI.iOS.SplitWindow.md).

## Example: Simple Navigation Window

Creates a navigation window with the first window colored red.
Press the button to open the blue window.
Use the back button to return to the red root window.

``` js
var win2 = Ti.UI.createWindow({
    backgroundColor: 'red',
    title: 'Red Window'
});

var win1 = Ti.UI.iOS.createNavigationWindow({
    window: win2
});

var win3 = Ti.UI.createWindow({
    backgroundColor: 'blue',
    title: 'Blue Window'
});

var button = Ti.UI.createButton({
    title: 'Open Blue Window'
});
button.addEventListener('click', function(){
    win1.openWindow(win3, {animated:true});
});

win2.add(button);
var button2 = Titanium.UI.createButton({
    title: 'Close Blue Window'
});
button2.addEventListener('click', function(){
    win1.closeWindow(win3, {animated:false}); //win3.close() will also work!!
});

win3.add(button2);
win1.open();
```

## Example: Alloy XML Markup

Previous example as two Alloy view-controllers.  Requires Alloy 1.2.2 and later.

app/views/index.xml:
``` xml
<Alloy>
    <NavigationWindow id="win1" platform="ios">
        <Window id="win2" title="Red Window" backgroundColor="red">
            <Button id="button" onClick="openBlueWindow">Open Blue Window</Button>
        </Window>
    </NavigationWindow>
</Alloy>
```

app/controllers/index.js:
``` js
function openBlueWindow(e) {
    var win3 = Alloy.createController('bluewin').getView();
    $.win1.openWindow(win3);
}

$.win1.open();
```

app/views/bluewin.xml:
``` xml
<Alloy>
    <Window id="win3" title="Blue Window" backgroundColor="blue">
        <Button onClick="closeWindow">Close Window</Button>
    </Window>
</Alloy>
```

app/controllers/bluewin.js:
``` js
function closeWindow(){
    $.win3.close();
}
```

## Properties

### window

- Type: Titanium.UI.Window
- Platforms: iPhone, iPad, macOS

Window to add to this navigation window.

## Methods

### closeWindow

- Platforms: iPhone, iPad, macOS

Closes a window and removes it from the navigation window.

Parameters:

- `window` (Titanium.UI.Window): Window to close.
- `options` (Dictionary): Options supporting a single `animated` boolean property to determine whether the window will be animated (default) while being closed (default: true).

### openWindow

- Platforms: iPhone, iPad, macOS

Opens a window within the navigation window.

Parameters:

- `window` (Titanium.UI.Window): Window to open.
- `options` (Dictionary): Options supporting a single `animated` boolean property to determine whether the window will be animated (default) while being opened (default: true).

### popToRootWindow

- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 6.0.0

Closes all windows that are currently opened inside the navigation window.

Note that only the `close` event of the most recently opened window is fired.

Parameters:

- `options` (Dictionary): Options supporting a single `animated` boolean property to determine whether the windows will be animated while being closed (default: false).

## Inherited members

112 members are inherited. Each is documented on the type that declares it.

- [Titanium.Proxy](https://titaniumsdk.com/docs/sdk/12.7.0/Titanium.Proxy.md): `addEventListener`, `apiName`, `applyProperties`, `bubbleParent`, `fireEvent`, `removeEventListener`
- [Titanium.UI.View](https://titaniumsdk.com/docs/sdk/12.7.0/Titanium.UI.View.md): `accessibilityHidden`, `accessibilityHint`, `accessibilityLabel`, `accessibilityValue`, `add`, `anchorPoint`, `animate`, `animatedCenter`, `backgroundGradient`, `backgroundImage`, `backgroundLeftCap`, `backgroundRepeat`, `backgroundTopCap`, `borderColor`, `borderRadius`, `borderWidth`, `center`, `children`, `clearMotionEffects`, `click`, `clipMode`, `convertPointToView`, `dblclick`, `doubletap`, `getViewById`, `height`, `hide`, `horizontalMotionEffect`, `horizontalWrap`, `id`, `insertAt`, `keypressed`, `layout`, `longpress`, `pinch`, `postlayout`, `previewContext`, `pullBackgroundColor`, `rect`, `remove`, `replaceAt`, `rotate`, `rotation`, `show`, `singletap`, `size`, `swipe`, `tintColor`, `toImage`, `tooltip`, `touchEnabled`, `touchcancel`, `touchend`, `touchmove`, `touchstart`, `transform`, `twofingertap`, `verticalMotionEffect`, `viewShadowColor`, `viewShadowOffset`, `viewShadowRadius`, `visible`, `width`, `zIndex`
- [Titanium.UI.Window](https://titaniumsdk.com/docs/sdk/12.7.0/Titanium.UI.Window.md): `autoAdjustScrollViewInsets`, `backgroundColor`, `blur`, `bottom`, `close`, `close`, `closed`, `extendEdges`, `extendSafeArea`, `focus`, `focused`, `fullscreen`, `hideNavBar`, `hideTabBar`, `hideToolbar`, `hidesBackButton`, `hidesBarsOnSwipe`, `hidesBarsOnTap`, `hidesBarsWhenKeyboardAppears`, `hidesSearchBarWhenScrolling`, `homeIndicatorAutoHidden`, `includeOpaqueBars`, `largeTitleDisplayMode`, `largeTitleEnabled`, `left`, `leftNavButtons`, `modal`, `navigationWindow`, `opacity`, `open`, `open`, `orientation`, `orientationModes`, `right`, `rightNavButtons`, `safeAreaPadding`, `showNavBar`, `showTabBar`, `showToolbar`, `statusBarStyle`, `titleAttributes`, `top`

---

- This corpus documents Titanium SDK 13.4.1. Anything here that does not name a version describes 13.4.1.
- Titanium is maintained by TiDev. The Appcelerator toolchain is retired: there is no `appc` CLI, no Appcelerator Studio and no hosted build service. The supported CLI is `titanium` on npm, invoked as `ti`.

