Closed kmadired closed 9 years ago
I am not totally sure what you guys are asking. But, you can alway do ViewControllers = new []{ new UINavigationController(new UIViewController { View = new UILabel { Text = "Animals (drag right)" }}),...
@Clancey Thank you for your reply. The problem is as follows. If I put a button in the Animals view controller, and I want to go to Vegetables view controller by clicking the button, is it possible?
Yes. navigation.SelectedIndex = 1;
Great. let me test it. Can I ask another question? If I put another button in the Animals view controller, and want to go into new detail view controller(ex: Dog view controller ), how can achieve this?
just like you would for normal navigation. Either push it to a navigation stack or present it modally.
base.ViewDidLoad (); var navigation = new FlyoutNavigationController { // Create the navigation menu NavigationRoot = new RootElement ("Navigation") { new Section ("Pages") { new StringElement ("Animals"), new StringElement ("Vegetables"), new StringElement ("Minerals"), } }, // Supply view controllers corresponding to menu items: ViewControllers = new [] { new UIViewController { View = new UILabel { Text = "Animals (drag right)" } }, new UIViewController { View = new UILabel { Text = "Vegetables (drag right)" } }, new UIViewController { View = new UILabel { Text = "Minerals (drag right)" } }, }, }; // Specify navigation position navigation.Position = FlyOutNavigationPosition.Left; // Show the navigation view navigation.ToggleMenu (); View.AddSubview (navigation.View);
How do I set the Navigation Bar styles like background color, title, left icon etc? Is there a way to navigate from one view controller to other via UIButton in the first view controller?