Removing the UINavigationItem prompt makes black space at the bottom of the navigation bar

I have a view controller in my storyboard using a quick text bar, but when I click on a new view controller without a tooltip in the navigation bar, I get this (see the picture) black space between the navigation bar and the main view of the controller.

black area under the navigation bar

i already tried removing the prompt using this:

[self.navigationItem setPrompt:nil]; 

but i still have this problem.

+6
source share
2 answers

Here is the work for setPrompt. It does not revive, so I call this a workaround instead of a solution. Must be in viewDidAppear, not viewWillAppear.

 -(void) viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; // This is needed for apple bug with self.navigationItem.prompt [self.navigationController.navigationBar setNeedsUpdateConstraints]; } 
+2
source

I ran into the same issue by deleting the invitation in viewWillDissapear before the view I presented would work for me:

 - (void) viewWillDisappear:(BOOL)animated { [super viewWillDisappear:animated]; [[self navigationItem] setPrompt: nil]; } 
0
source

All Articles