如何隐藏导航控制器后退按钮并在iOS xamarin monotouch中创建左栏按钮和右栏按钮

时间:2014-02-13 13:07:14

标签: c# ios xamarin.ios xamarin

我想隐藏导航后退栏按钮它不起作用我在下面提到了我的代码:

this.NavigationItem.HidesBackButton = true;

    this.NavigationItem.SetRightBarButtonItem(
        new UIBarButtonItem(UIBarButtonSystemItem.Save, (sender,args) => 
            {

                Console.WriteLine("clicking save");
                // button was clicked
            } )
        , true);

    this.NavigationItem.SetLeftBarButtonItem(new UIBarButtonItem(UIBarButtonSystemItem.Cancel,(sender,EventArgs)=>
        {
            Console.WriteLine("button was clicked");
            this.NavigationController.PopViewControllerAnimated(true);
        } )
        ,true);

此代码无法正常工作按钮未隐藏。有人建议我如何执行此操作。

0 个答案:

没有答案