public override void RowSelected(UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath) { var listViewController1 = new ListViewController(); var listViewController2 = new ListViewController(); listViewController1.Title = @"Another Tab 1"; listViewController2.Title = @"Another Tab 2"; var tabBarController = new MHTabBarController(0); tabBarController.SetViewControllers(new[] { listViewController1, listViewController2 }); tabBarController.Title = @"Modal Screen"; tabBarController.NavigationItem.LeftBarButtonItem = new UIBarButtonItem(UIBarButtonSystemItem.Done, delegate { _root.DismissViewController(true, null); }); UINavigationController navController = new UINavigationController(tabBarController); navController.NavigationBar.TintColor = UIColor.Black; _root.PresentViewController(navController, true, null); }
public override bool FinishedLaunching(UIApplication app, NSDictionary options) { var listViewController1 = new ListViewController(); var listViewController2 = new ListViewController(); var listViewController3 = new ListViewController(); listViewController1.Title = "Tab 1"; listViewController2.Title = "Tab 2"; listViewController3.Title = "Tab 3"; listViewController2.TabBarItem.Image = UIImage.FromFile("images/Taijitu.png"); listViewController2.TabBarItem.ImageInsets = new UIEdgeInsets(0.0f, -4.0f, 0.0f, 0.0f); listViewController2.TabBarItem.TitlePositionAdjustment = new UIOffset(4.0f, 0.0f); var viewControllers = new[] { listViewController1, listViewController2, listViewController3 }; MHTabBarController tabBarController = new MHTabBarController(0); tabBarController.SetViewControllers(viewControllers); window = new UIWindow (UIScreen.MainScreen.Bounds); window.BackgroundColor = UIColor.White; window.RootViewController = tabBarController; window.MakeKeyAndVisible (); return true; }