1

我在分割視圖上使用導航欄時出現問題。我想在左側視圖中顯示我的TableView的導航欄(請參見圖片Click Here)。 這是我的AppDelegate:無法在SplitView上顯示NavigationBar MonoTouch

public override bool FinishedLaunching (UIApplication app, NSDictionary options) 
    { 
     // create a new window instance based on the screen size 
     window = new UIWindow (UIScreen.MainScreen.Bounds); 

     this.masterViewController = new MasterViewControl(); 
     this.detailViewController = new DetailViewController(); 

     this.splitController = new UISplitViewController(); 
     this.splitController.ViewControllers = new UIViewController[] { 
      this.masterViewController, 
      this.detailViewController 
     }; 

     this.splitController.Delegate = new SplitControllerDelegate(this.detailViewController); 

     window.RootViewController = this.splitController; 

     // make the window visible 
     window.MakeKeyAndVisible(); 

     return true; 
    } 

而且MasterViewController IM試圖用這種方式

'this.buttonAdd = new UIBarButtonItem("Edit", UIBarButtonItemStyle.Bordered, this.ButtonAdd_Clicked); 
this.NavigationItem.SetRightBarButtonItem (this.buttonAdd, true);' 

回答

4

你可能想嘗試一個現有的解決方案,像MGSplitViewController。有一個可用的視頻here

original source code(objective-c)和MonoTouch bindings可用。

或者您可以使用Krumelur的MonoTouch/C# port,如果您想更改/更新代碼庫,這將更易於使用。