2013-04-12 43 views
0

James Clancey在monotouch上使用彈出窗口導航。無法讓子視圖控制器在主控制器上優雅地執行一個循環?FlyoutNavigation子視圖控制器無法在主控制器上執行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); 

*更新: 我放棄了SEGUE。而不是使用附加視圖控制器,我依靠的意見,但我的觀點一個是靜態的單細胞的tableview和不知道如何將它添加到上面的代碼liek這樣:

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

我該怎麼辦?

回答

0

您可以使用導航功能的..

ViewControllers = new [] { 

new UINavigationController (this.Storyboard.InstantiateViewController("profileViewController") as ProfileViewController), 
} 
+0

如何在AppDelegate類中獲得故事板的實例?我有一個類似的問題,我使用FlyoutNavigationController作爲根,因此需要在AppDelegate中實例化控制器,並且它們正在使用Storyboard – appcoder

相關問題