Question

I am trying to hide the back button from my navigationcontroller on a certain view(using storyboard)

I tried to hide the bar back button overriding the ViewWillAppear, but it does not seem to happen.

Here is the code:

public override void ViewWillAppear (bool animated)
{
    base.ViewWillAppear (animated);
    this.NavigationController.NavigationItem.SetHidesBackButton (true, true);
}
Was it helpful?

Solution

just change to :

public override void ViewDidLoad ()
{
    base.ViewDidLoad ();

    this.NavigationItem.SetHidesBackButton (true, false);
}

OTHER TIPS

Below is the best answer which works well with xamarin forms too Add this code in App delegate.This solved my problem too

UIBarButtonItem.Appearance.SetBackButtonTitlePositionAdjustment (new UIOffset (-100, -60), UIBarMetrics.Default);

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top