Reputation: 1013
I'm new in Xamarin iOS development. I use NavigationController in my project. I want to hide a NavigationBar in a particular ViewController. Following code hides the bar, but doesn't eliminate the space.
public override void ViewWillAppear(bool animated)
{
base.ViewWillAppear(animated);
this.NavigationItem.LeftBarButtonItem = null;
this.NavigationItem.HidesBackButton = true;
this.NavigationController.ToolbarHidden = true;
}
I want to eliminate the space as shown in the red broken frame.
Upvotes: 1
Views: 65
Reputation: 74209
NavigationBarHidden
property to false:NavigationController.NavigationBarHidden = true;
Or if you what to animate that, use the SetNavigationBarHidden
method:
NavigationController.SetNavigationBarHidden(true, true);
NavigationController.SetNavigationBarHidden(false, true);
Upvotes: 1