UINavigationController class implements a specialized view controller that manages the
navigation of hierarchical content. This navigation interface makes it possible to present your data efficiently and also makes it easier for the user to navigate that content.
||The background color of the NavigationController.
||The title of the current page in the NavigationController.
||Shows / hides the NavigationController.
|PushViewController(AViewController:TTMSFMXNativeUIViewController; AAnimated: Boolean);
||Pushes a ViewController on the stack with optional animation
||Pops the last added ViewController on the stack with optional animation.
||Returns a reference to the native iOS
||Event to perform custom drawing inside the NavigationController.
Pushing and popping pages (ViewControllers)
The NavigationController can be filled with Pages and has a toolbar at the top. The pages
can be pushed and popped from the main NavigationController through code. You can add
as many pages as you wish by adding a
TTMSFMXNativeUIViewController for each page.
Below is a sample with 3 pages.
Drop an instance of
TTMSFMXNativeUINavigationController and 2 instances of
TTMSFMXNativeUIViewController on the form. Set the title for each controller like the
TMSFMXNativeUINavigationController1.Title := ‘First Page’;
TMSFMXNativeUIViewController1.Title := ‘Second Page’;
TMSFMXNativeUIViewController2.Title := ‘Third Page’;
TMSFMXNativeUIButton instance as a child of the first page, the
TMSFMXNativeUINavigationController. In the
OnClick event, add the following code:
This will push the second page in place and update the toolbar with a back button. The
back button will allow you to navigate to the previous page. This can also be done with the
second page by dropping a button on the first page and adding the code:
If you press on the first button, and on the second button, the NavigationController will
push 2 ViewControllers in place and update back button to return to the second page. The
hierarchy is now updated with 3 pages. To return one step in the hierarchy, call