[英]Can't show NavigationBar on SplitView MonoTouch
我在拆分视图上使用导航栏时遇到问题。 我希望导航栏显示在TableView的左侧视图中(请参阅图片单击此处 )。 这是我的AppDelegate:
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我试图以这种方式使用它
'this.buttonAdd = new UIBarButtonItem("Edit", UIBarButtonItemStyle.Bordered, this.ButtonAdd_Clicked);
this.NavigationItem.SetRightBarButtonItem ( this.buttonAdd, true);'
您可能想尝试现有的解决方案,例如MGSplitViewController
。 还有它提供的视频在这里 。
原始源代码 (objective-c)和MonoTouch 绑定可用。
或者,您可以使用Krumelur的MonoTouch / C#端口 ,如果您要更改/更新代码库,它将更易于使用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.