Reputation: 11
Does anyone have an example for NavigationController.PopToViewContoller();
using MonoTouch/Xamarin?
Upvotes: 1
Views: 1168
Reputation: 509
To go back to the last ViewController:
this.NavigationController.PopViewControllerAnimated(true);
To go to the Root View Controller
this.NavigationController.PopToRootViewController(true);
To go to a new viewController do this:
this.NavigationController.PopToViewController( MyNewViewController, true);
Upvotes: 5
Reputation: 1299
First the view controller you want to pop to, needs to be in the navigation stack, so you must have pushed to it at some point previously in navigation.
Upvotes: 0