小编Mem*_*mer的帖子

如何在NavigationController上启用/添加BackButton?

我尝试了很多方法,但没有成功.

通过这种方式,我可以创建一个新的UIBarButtonItem并且它可以工作,问题是它像lockButton/ArrowBackButton一样锁定:

            public override void ViewWillAppear (bool animated) 
            { 
               base.ViewWillAppear (animated);  


               this.NavigationItem.LeftBarButtonItem = new UIBarButtonItem  ("Tillbaka", UIBarButtonItemStyle.Plain, delegate(object sender, EventArgs e) { 
               this.NavigationController.PopViewControllerAnimated (true);  
                    }); 

            } 
Run Code Online (Sandbox Code Playgroud)

尝试了这个,但没有奏效:

      public override void ViewWillAppear (bool animated)
     {
        base.ViewWillAppear (animated); 

            this.NavigationItem.SetHidesBackButton(false,true);

         }
Run Code Online (Sandbox Code Playgroud)

c# uinavigationcontroller uibarbuttonitem xamarin.ios uinavigationitem

4
推荐指数
1
解决办法
1434
查看次数