# Titanium.UI.NavigationWindow

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

- Source: https://titaniumsdk.com/docs/sdk/12.6.1/Titanium.UI.NavigationWindow
- Titanium SDK version: 12.6.1
- Kind: view
- Platforms: Android, iPhone, iPad, macOS
- Since: Titanium SDK 8.0.0
- Extends: Titanium.UI.Window
- Inheritance: Titanium.UI.Window > Titanium.UI.View > Titanium.Proxy

You create a `NavigationWindow` with the [Titanium.UI.createNavigationWindow](https://titaniumsdk.com/docs/sdk/Titanium.UI.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 = Titanium.UI.createWindow({
    backgroundColor: 'red',
    title: 'Red Window'
});

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

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

var button = Titanium.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">
        <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

### interactiveDismissModeEnabled

- Type: Boolean
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK 12.5.0
- Default: `false`

A boolean indicating whether or not child windows of this navigation window
should have the ability to be swipe-to-closed over the full width of it's window or not.

### window

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

Window to add to this navigation window.

## Methods

### closeWindow

- Platforms: Android, 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: Android, iPhone, iPad, macOS

Opens a window within the navigation window.

Parameters:

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

### popToRootWindow

- Platforms: Android, iPhone, iPad, macOS

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` (AnimatedOptions, optional): Options supporting a single `animated` boolean property to determine whether the windows will be animated while being closed (default: false). Default: `{ animated: false }`.

## Inherited members

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

- [Titanium.Proxy](https://titaniumsdk.com/docs/sdk/12.6.1/Titanium.Proxy.md): `addEventListener`, `apiName`, `applyProperties`, `bubbleParent`, `fireEvent`, `lifecycleContainer`, `removeEventListener`
- [Titanium.UI.View](https://titaniumsdk.com/docs/sdk/12.6.1/Titanium.UI.View.md): `accessibilityDisableLongPress`, `accessibilityHidden`, `accessibilityHint`, `accessibilityLabel`, `accessibilityValue`, `add`, `anchorPoint`, `animate`, `animatedCenter`, `backgroundDisabledColor`, `backgroundDisabledImage`, `backgroundFocusedColor`, `backgroundFocusedImage`, `backgroundGradient`, `backgroundImage`, `backgroundLeftCap`, `backgroundRepeat`, `backgroundSelectedColor`, `backgroundSelectedImage`, `backgroundTopCap`, `borderColor`, `borderRadius`, `borderWidth`, `center`, `children`, `clearMotionEffects`, `click`, `clipMode`, `convertPointToView`, `dblclick`, `doubletap`, `elevation`, `filterTouchesWhenObscured`, `focusable`, `getViewById`, `height`, `hiddenBehavior`, `hide`, `horizontalMotionEffect`, `horizontalWrap`, `id`, `insertAt`, `keepScreenOn`, `keypressed`, `layout`, `longclick`, `longpress`, `overrideCurrentAnimation`, `pinch`, `postlayout`, `previewContext`, `pullBackgroundColor`, `rect`, `remove`, `replaceAt`, `rotation`, `rotationX`, `rotationY`, `scaleX`, `scaleY`, `show`, `singletap`, `size`, `softKeyboardOnFocus`, `stopAnimation`, `swipe`, `tintColor`, `toImage`, `tooltip`, `touchEnabled`, `touchFeedback`, `touchFeedbackColor`, `touchcancel`, `touchend`, `touchmove`, `touchstart`, `transform`, `transitionName`, `translationX`, `translationY`, `translationZ`, `twofingertap`, `verticalMotionEffect`, `viewShadowColor`, `viewShadowOffset`, `viewShadowRadius`, `visible`, `width`, `zIndex`
- [Titanium.UI.Window](https://titaniumsdk.com/docs/sdk/12.6.1/Titanium.UI.Window.md): `activity`, `activityEnterTransition`, `activityExitTransition`, `activityReenterTransition`, `activityReturnTransition`, `activitySharedElementEnterTransition`, `activitySharedElementExitTransition`, `activitySharedElementReenterTransition`, `activitySharedElementReturnTransition`, `addSharedElement`, `androidback`, `androidcamera`, `androidfocus`, `androidsearch`, `androidvoldown`, `androidvolup`, `autoAdjustScrollViewInsets`, `backgroundColor`, `blur`, `bottom`, `close`, `close`, `closed`, `exitOnClose`, `extendEdges`, `extendSafeArea`, `flagSecure`, `focus`, `focused`, `fullscreen`, `hideNavBar`, `hideToolbar`, `hidesBackButton`, `hidesBarsOnSwipe`, `hidesBarsOnTap`, `hidesBarsWhenKeyboardAppears`, `hidesSearchBarWhenScrolling`, `homeIndicatorAutoHidden`, `includeOpaqueBars`, `largeTitleDisplayMode`, `largeTitleEnabled`, `left`, `leftNavButtons`, `modal`, `navigationWindow`, `onBack`, `opacity`, `open`, `open`, `orientation`, `orientationModes`, `removeAllSharedElements`, `right`, `rightNavButtons`, `safeAreaPadding`, `showNavBar`, `showToolbar`, `splitActionBar`, `statusBarColor`, `statusBarStyle`, `sustainedPerformanceMode`, `theme`, `titleAttributes`, `top`, `windowFlags`, `windowPixelFormat`, `windowSoftInputMode`

---

- 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`.

