user763129
user763129

Reputation: 11

MonoTouch PopToViewController

Does anyone have an example for NavigationController.PopToViewContoller(); using MonoTouch/Xamarin?

Upvotes: 1

Views: 1168

Answers (3)

nytrm
nytrm

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

Yasir Kamal
Yasir Kamal

Reputation: 443

[self.navigationController popViewControllerAnimated:YES];

Upvotes: 0

Pavel Sich
Pavel Sich

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

Related Questions