FlyoutNavigation子视图控制器无法在主控制器上执行segue?

时间:2013-04-12 22:57:44

标签: ios xamarin.ios segue xamarin

James Clancey在monotouch上使用弹出导航。无法让主视图控制器在主控制器上优雅地执行segue?

        NavigationRoot = new RootElement ("Navigation") {
            new Section ("Menu") {
                new StringElement ("Mapview Controller"),
                new StringElement ("Another View Controller"),
            }
        },

        ViewControllers = new [] {

      // mapview is a view inside this viewcontroller and able to perform segues
            new UIViewController { View = mapView },

      // this is a seperate viewcontroller but is embedded inside the flyoutNavigation
     // AnotherViewController cant seem to call the root navigation controller (<-- actually a uiNav inside a tab bar nav) so i can perform a segue movement just like the above mapViewController??
            this.Storyboard.InstantiateViewController("AnotherViewController") as AnotherViewController,

        },


    // sub viewcontroller i.e. AnotherViewController trying to move mainViewController to perform a segue..
    // throws error: Receiver (<FlyoutNavigation.FlyoutNavigationController: 0x14360600>) has no segue with identifier 'segueTest'

   this.ParentViewController.PerformSegue("segueTest", this);

* 更新: 我放弃了赛格。我没有使用额外的视图控制器,而是依赖于视图,但我的一个视图是静态细胞化的tableview,并且不确定如何将它添加到上面的代码中,所以:

        ViewControllers = new [] {
            new UIViewController { View = mapView },
            new UIViewController { View = myTableView } // doesnt work - tried with 'new UITableViewController' which also fails

我该怎么办?

1 个答案:

答案 0 :(得分:0)

你可以使用导航..

  ViewControllers = new [] {

new UINavigationController (this.Storyboard.InstantiateViewController("profileViewController") as ProfileViewController),
}
相关问题