Reputation: 327
I'm trying to set up a user interface programmatically using Xamarin. (c#). How do I embed say Navigation Controllers, Tab bar controllers, and page controllers? Thank you in advance.
Upvotes: 2
Views: 262
Reputation: 89204
You could place this in your AppDelegate's FinishedLaunching
var tab = new UITabBarController ();
var nav1 = new UINavigationController (new MyViewController1 ());
var nav2 = new UINavigationController (new MyViewController2 ());
var nav3 = new UINavigationController (new MyViewController3 ());
tab.ChildViewControllers = new [] { nav1, nav2, nav3 };
Window.RootViewController = tab;
Upvotes: 2