Forum Xamarin.iOS

Flyout Menu and Segues

Hi All, just after a bit of advice, I am using the flyout menu component on IOS to replicate the android drawers functionality I have already written into my android app. All was going well using the below code in my initial view controller, however what I want to happen is that I would like to seque to other view controllers from the initial list that is available in the menu but when I try to do this I get the following message

Presenting view controllers on detached view controllers is discouraged

And the sequed controller then seems to break the flyout menu.

public override void ViewDidLoad ()
base.ViewDidLoad ();

        navController = new FlyoutNavigationController {//this will create a new instance of the FlyoutComponent
            NavigationRoot = new RootElement("Menu"){ //Here we create the root of the alements
                new Section("Menu"){
                    new StringElement("Home"),
                    new StringElement("Venues"),
                    new StringElement("Exhibitors"),
                    new StringElement("Features"),
                    new StringElement("Map"),
                    new StringElement("Saved Items"),
            ViewControllers =  new [] {//here we link Controllers
                this.Storyboard.InstantiateViewController("eventScheduleViewController") as UIViewController,//here we create the instances for the Controllers
                this.Storyboard.InstantiateViewController("eventAboutViewController") as UIViewController,
                this.Storyboard.InstantiateViewController("eventScheduleViewController") as UIViewController,
                this.Storyboard.InstantiateViewController("eventAboutViewController") as UIViewController,
                this.Storyboard.InstantiateViewController("eventAboutViewController") as UIViewController,
                this.Storyboard.InstantiateViewController("eventAboutViewController") as UIViewController,

        navController.View.Frame = new RectangleF(0,0,this.View.Bounds.Width,this.View.Bounds.Height);
        navController.NavigationTableView.BackgroundColor = UIColor.DarkGray;
        navController.NavigationTableView.RowHeight = 30;
        navController.NavigationTableView.SeparatorStyle = UITableViewCellSeparatorStyle.SingleLine;
        navController.NavigationTableView.SeparatorColor = UIColor.LightGray;
        navController.NavigationTableView.SectionHeaderHeight = 60;

        View.AddSubview (navController.View);

        UIBarButtonItem menuIndicator = new UIBarButtonItem (UIImage.FromBundle   ("images/weather_LIGHTCLOUD.png"), UIBarButtonItemStyle.Plain, (sender, e) => {
            navController.ToggleMenu ();
        NavigationItem.SetLeftBarButtonItem (menuIndicator, false);


  • paulsandhampaulsandham GBMember

    Anyone ?

  • I have the same question, but people react so slow here.....
    It's just a sad, sad situation

  • By the way, your code helped me out big time.
    You wanted to segue to the next screen? Am I right?

    Not needed, just set the Storyboard ID of your UIViewController.
    Not the name, but the StoryBoard ID.

    Once that is set, use the same name as a string in this line of code:
    this.Storyboard.InstantiateViewController("eventAboutViewController") as UIViewController,

    So name your StoryBoard ID to eventAboutViewController



Sign In or Register to comment.