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

  • IController
  • ControllerPresentParams
    • INavigationController

Implemented by

Properties

nativeObject: any
transitionViews?: IView<"touch" | "touchCancelled" | "touchEnded" | "touchMoved", { [key: string]: any }, MobileOSProps<ViewIOSProps, ViewAndroidProps>>[]
pageID: number
popUpBackPage?: any
tabBar?: IBottomTabBar | IController<any> | TabBarController
childControllers: Controller[]

Gets/sets child controllers of NavigationController instance.

Property

Android

Ios

Since

3.2.0

headerBar: HeaderBar

Gets headerBar of NavigationController instance.

Property

Android

Ios

Since

3.2.0

dismissStart: (() => void)

Type declaration

    • (): void
    • Returns void

dismissComplete: (() => void)

Type declaration

    • (): void
    • Returns void

dismissCancel: (() => void)

Type declaration

    • (): void
    • Returns void

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

Type declaration

    • (): void
    • Returns void

onCompleteCallback?: (() => void)

Type declaration

    • (): void
    • Returns void

animationType?: AnimationType
options?: {}

Type declaration

    sheetPresentationController?: any

    Methods

    • 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

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

      Method

      push

      Android

      Ios

      Since

      3.2.0

      Parameters

      • params: { controller: Controller; animated?: boolean }
        • controller: Controller
        • 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: Controller; animated?: boolean }
        • controller: Controller
        • Optional animated?: boolean

      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); animated: boolean }
        • onComplete: (() => void)
            • (): void
            • Returns void

        • animated: boolean

      Returns void

    Events

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

    Type declaration

      • (params: { controller: Controller; animated?: boolean }): void
      • This event is triggered before the page is displayed.

        willShow

        Android

        Since

        3.2.0

        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

    Generated using TypeDoc