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
Constructor private
Singleton navigationBar
Namespace tabris
Direct subclasses None
JSX support No

Example

import {navigationBar} from 'tabris';

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

See also:

Properties

background

Android

Background color of the navigation bar.

Type ColorValue
Settable Yes

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

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

This property can only be set via constructor or JSX. 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 Events

themeChanged

Fired when the theme property has changed.

Parameter Type Description
value string The new value of theme.

displayModeChanged

Fired when the displayMode property has changed.

Parameter Type Description
value string The new value of displayMode.

backgroundChanged

Fired when the background property has changed.

Parameter Type Description
value ColorValue The new value of background.