Clancey / FlyoutNavigation

Other
95 stars 87 forks source link

Navigation Bar #60

Closed kmadired closed 9 years ago

kmadired commented 9 years ago

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?

blue-earth commented 9 years ago
  1. You can access via navigation.NavigationController.
  2. It seems there is no way to navigate from one view controller to other via UIButton in the first view controller if you choose this control. Clancey keep silence about it. :(
Clancey commented 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)" }}),...

blue-earth commented 9 years ago

@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?

Clancey commented 9 years ago

Yes. navigation.SelectedIndex = 1;

blue-earth commented 9 years ago

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?

Clancey commented 9 years ago

just like you would for normal navigation. Either push it to a navigation stack or present it modally.