Drawer

A drawer that can be swiped in from the left edge of the screen. There’s only a single instance that can be accessed via . The drawer is locked by default. To use it in an application, set the property locked to false. The drawer can contain any kind of widgets.

Import this type with “const {Drawer} = require('tabris');

Returns:this

Closes the drawer.

open()

Returns:this

Opens the drawer. It may be useful to call this method on first startup, so that users notice the drawer and its contents.

enabled

Type: boolean, default:

Controls whether the drawer can be opened and closed. When set to false, the drawer cannot be opened and calls to drawer.open() will be ignored.

Windows 10

Controls how the drawer integrates into its targetView.

  • compactOverlay makes the drawer partially visible when closed so a 48px wide bar remains side-by-side with the targetViews other content. If a drawer-action controls the drawer it is placed inside this bar. When the drawer is opened its remaining width overlays the targetViews other content.
  • inline completely hides the drawer when closed, but shows it side-by-side with the targetView when opened. The drawer does not close automatically in this mode.
  • compactInline makes the drawer partially visible when closed (like compactOverlay), but shows it side-by-side with the targetView when opened (like inline).
    Available only on windows.

win_targetView

Windows 10

Type: , default:

This property may be set to an instance of NavigationView to make its drawer-action open/close the drawer. It also integrates the drawer into the NavigationView layout. When not set to NavigationView instance the property defaults to tabris.ui. Other widgets are not supported. Available only on Windows.

close

iOSAndroid

Fired when the drawer is closed and has reached its resting position.

Fired when the property has changed.

Event Parameters

  • value: boolean The new value of .

open

Fired when the drawer is opened and has reached its resting position.

win_displayModeChanged

Fired when the win_displayMode property has changed.

Event Parameters

  • target: this The widget the event was fired on.

  • value: string The new value of win_displayMode.

Fired when the property has changed.

Event Parameters

原文: