Since

3.2

Example

import Page from '@smartface/native/ui/page';
import NavigationController from '@smartface/native/ui/navigationcontroller';

var page1 = new Page();
var navigationController = new NavigationController(); //// OR IT CAN TAKES a controller object like tabbarcontroller AS AN ARGUMENT
navigationController.childControllers = [page1];
navigationController.headerBar.translucent = true;
var page2 = new Page();
page2.navigationItem.title = "Page1";
navigationController.push({controller: page2, animation: true});

var page3 = new Page();
page3.parentController.headerBar.backgroundColor = Color.RED;
navigationController.push({controller: page3, animation: true});

var page4 = new Page();
navigationController.push({controller: page4, animation: true});
navigationController.childControllers; /// Returns [page1,page2,page3,page4];
navigationController.popTo({controller: page2, animation: true});
navigationController.childControllers; /// Returns [page1,page2];

navigationController.pop();
navigationController.childControllers; /// Returns [page1];

navigationController.willShow = function ({controller: controller, animation: animation}) {};
navigationController.onTransition = function ({currentController: currentController, targetController: targetController, operation: operation}) /// => operation means (push || pop)

Hierarchy

  • NativeMobileComponent
    • Navigationcontroller

Implements

Properties

_nativeObject: any
dismissStart: (() => void)

Type declaration

    • (): void
    • Returns void

dismissComplete: (() => void)

Type declaration

    • (): void
    • Returns void

dismissCancel: (() => void)

Type declaration

    • (): void
    • Returns void

transitionViews?: IView<"touch" | "touchCancelled" | "touchEnded" | "touchMoved", { [key: string]: any }, MobileOSProps<ViewIOSProps, ViewAndroidProps>>[]
popUpBackPage?: any
onCompleteCallback?: (() => void)

Type declaration

    • (): void
    • Returns void

childControllers: Controller[]

Gets/sets child controllers of NavigationController instance.

Property

Android

Ios

Since

3.2.0

willShow: ((params: { controller: Controller; animated?: boolean }) => void)

Type declaration

    • (params: { controller: Controller; animated?: boolean }): void
    • Parameters

      • params: { controller: Controller; animated?: boolean }
        • controller: Controller
        • Optional animated?: boolean

      Returns void

onTransition: ((e: { controller: Controller; operation: OperationType; currentController?: Controller; targetController?: Controller }) => void)

Type declaration

headerBar: HeaderBar

Gets headerBar of NavigationController instance.

Property

Android

Ios

Since

3.2.0

parentController: INavigationController
controller: IController<any>
animation?: boolean
animated?: boolean
isComingFromPresent?: boolean
onComplete?: (() => void)

Type declaration

    • (): void
    • Returns void

animationType?: AnimationType
tabBar?: TabBarController
pageID: number
popupBackNavigator: boolean
isInsideBottomTabBar: boolean
OperationType: typeof OperationType

Accessors

  • get nativeObject(): any
  • Returns any

  • set nativeObject(value: any): void
  • Parameters

    • value: any

    Returns void

  • get ios(): TProps["ios"]
  • Returns TProps["ios"]

  • get android(): TProps["android"]
  • Returns TProps["android"]

  • get isActive(): boolean
  • Returns boolean

  • set isActive(value: boolean): void
  • Parameters

    • value: boolean

    Returns void

Methods

  • Executed before everything. This should return nativeObject since it will be assinged directly to nativeObject.

    Parameters

    • Optional params: Partial<Record<string, any>>

    Returns any

  • Parameters

    • Optional params: Partial<Record<string, any>>

    Returns void

  • Parameters

    • props: Partial<{ [key: string]: any }>

    Returns void

  • Parameters

    • props: Partial<{ [key: string]: any }>

    Returns void

  • This function shows up the pop-up controller.

    Method

    present

    Android

    Ios

    Since

    4.0.0

    Parameters

    • Optional params: ControllerPresentParams

    Returns void

  • This function dismiss presently shown pop-up controller.

    Method

    dismiss

    Android

    Ios

    Since

    4.0.0

    Parameters

    • Optional params: { onComplete: (() => void) }
      • onComplete: (() => void)
          • (): void
          • Returns void

    Returns void

  • Show page with animation parameter. Animated parameter is set to true as default.

    Method

    push

    Android

    Ios

    Since

    3.2.0

    Parameters

    • params: { controller: IController<any>; animated?: boolean }
      • controller: IController<any>
      • Optional animated?: boolean

    Returns void

  • Pop the last page from the navigation controller's page back stack.

    Method

    pop

    Android

    Ios

    Since

    3.2.0

    Parameters

    • Optional params: { animated?: boolean }
      • Optional animated?: boolean

    Returns void

  • Until the given page is found, the pages popped from back stack.

    Method

    popTo

    Android

    Ios

    Since

    3.2.0

    Parameters

    • params: { controller: IController<any>; animated?: boolean }
      • controller: IController<any>
      • Optional animated?: boolean

    Returns void

  • Parameters

    • Optional params: { controller: IController<any>; animated: any; isComingFromPresent?: boolean; onCompleteCallback?: (() => void) }
      • controller: IController<any>
      • animated: any
      • Optional isComingFromPresent?: boolean
      • Optional onCompleteCallback?: (() => void)
          • (): void
          • Returns void

    Returns void

Constructors

  • Parameters

    • Optional params: any

    Returns Navigationcontroller

Generated using TypeDoc