Xamarin IOS隐藏栏后退按钮
问题描述:
我试图在某个视图上(使用情节提要)隐藏我的导航控制器中的后退按钮
I am trying to hide the back button from my navigationcontroller on a certain view(using storyboard)
我试图隐藏覆盖ViewWillAppear
的后退按钮,但似乎没有发生.
I tried to hide the bar back button overriding the ViewWillAppear
, but it does not seem to happen.
这是代码:
public override void ViewWillAppear (bool animated)
{
base.ViewWillAppear (animated);
this.NavigationController.NavigationItem.SetHidesBackButton (true, true);
}
答
只需更改为:
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
this.NavigationItem.SetHidesBackButton (true, false);
}