簡體   English   中英

在SplitView MonoTouch上無法顯示NavigationBar

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM