简体   繁体   English

在SplitView MonoTouch上无法显示NavigationBar

[英]Can't show NavigationBar on SplitView MonoTouch

I have a problem using an navigation bar on my split view. 我在拆分视图上使用导航栏时遇到问题。 I want the navigationbar showing on the left view there my TableView is (see picture Click Here ). 我希望导航栏显示在TableView的左侧视图中(请参阅图片单击此处 )。 This is my AppDelegate: 这是我的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;
    }

And the MasterViewController im trying to use it this way 和MasterViewController我试图以这种方式使用它

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

You might want to try an existing solution, like MGSplitViewController . 您可能想尝试现有的解决方案,例如MGSplitViewController There's a video of it available here . 还有它提供的视频在这里

The original source code (objective-c) and MonoTouch bindings are available. 原始源代码 (objective-c)和MonoTouch 绑定可用。

Or you can use a MonoTouch/C# port from Krumelur, which will be easier to use if you want to change/update the code base. 或者,您可以使用Krumelur的MonoTouch / C#端口 ,如果您要更改/更新代码库,它将更易于使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Monotouch SplitView更改细节视图 - Monotouch SplitView changing the details view Monotouch-带有额外填充iOS 7的NavigationBar - Monotouch - NavigationBar with extra padding ios 7 MonoTouch.Dialog:NavigationBar中的后一项 - MonoTouch.Dialog: Back item in NavigationBar 单点触控键盘无法通过EndEditing隐藏(在ScrollView中) - monotouch keyboard can't be hidden with EndEditing (in ScrollView) MonoTouch无法从AccessoryButtonTapped打开新窗口 - MonoTouch can't open new window from AccessoryButtonTapped 使用RELEASE构建MonoTouch的SQLite - 无法获得PK? - SQLite with RELEASE build of MonoTouch - Can't get PK? 有没有理由我不能将null作为标题传递给MonoTouch中的UIActionSheet构造函数? - Is there a reason I can't pass null as the title to the UIActionSheet constructor in MonoTouch? 从接收到的响应流中读取数据时,无法在try / catch中捕获monotouch webexception - monotouch webexception can't be caught within try/catch when data is reading from received response stream 为什么我不能在 MonoTouch 上使用一个加密器加密多个字符串? - Why can't I encrypt multiple strings using one encryptor on MonoTouch? MonoTouch iOS应用程序无法在设备目录中找到文件-在模拟器上工作 - MonoTouch iOS application can't find files in directory on device - works on simulator
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM