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,如果您想更改/更新代码库,这将更易于使用。