Object “navigationBar”

Object > NativeObject > NavigationBar

The navigation bar is the onscreen area where Back, Home and similar buttons are displayed. The singleton instance can be accessed via navigationBar and is only supported on Android.

NavigationBar on Android
Android
Type: NavigationBar extends NativeObject
Constructor: private
Singleton: navigationBar
Namespace: tabris
Direct subclasses: None
JSX Support: No

Examples

JavaScript

import {navigationBar} from 'tabris';

navigationBar.background = 'red';
navigationBar.displayMode = 'float';

See also:

JSX Demonstrating various properties of the NavigationBar

Properties

background

Android

Background color of the navigation bar.

Type: ColorValue
Settable: Yes
Change Event: backgroundChanged

displayMode

Android

Controls how the navigation bar is positioned relative to the contentView. The value default places the content above the navigation bar. The hide option lets the navigation bar disappear, making room for the content. The float option lets the content flow underneath the navigation bar.

Type: 'default' | 'hide' | 'float'
Default: 'default'
Settable: Yes
Change Event: displayModeChanged

height

Android

The height of the navigation bar in device independent pixel. Can be used in conjunction with the displayMode float to offset the content as to not have it covered by the navigation bar.

Type: number
Settable: No
Change Event: Not supported

This property can only be set via constructor. Once set, it cannot change anymore.

theme

Android

Defines the appearance used on the navigation bar. A dark theme sets the foreground navigation icons to be of a light color, whereas light sets the icons to a dark color. The theme should be set in conjunction with the background property for contrast. The value default selects the default theme that depends on the device and on the app. Available on Android 8+.

Type: 'default' | 'light' | 'dark'
Default: 'default'
Settable: Yes
Change Event: themeChanged

Change Events

themeChanged

Fired when the theme property has changed.

EventObject Type: PropertyChangedEvent<NavigationBar, string>

Property Type Description
value string The new value of theme.

displayModeChanged

Fired when the displayMode property has changed.

EventObject Type: PropertyChangedEvent<NavigationBar, string>

Property Type Description
value string The new value of displayMode.

backgroundChanged

Fired when the background property has changed.

EventObject Type: PropertyChangedEvent<NavigationBar, ColorValue>

Property Type Description
value ColorValue The new value of background.