Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting navigationController.hidesBarsOnSwipe = YES never shows my navbar again

When i set navigationController.hidesBarOnSwipe = YES and try swiping in the webView shown the navigation bar is hidden, but it will never show up again, when i try swiping to get it back.

My ViewController is listening to the swipe event :

[self.navigationController.barHideOnSwipeGestureRecognizer addTarget:self action:@selector(swipe:)]?

But this selector is in fact never called again after the navigation bar is hidden because of the Swipe. Anyone implemented hidesBarOnSwipe? Is it a known bug or is it as designed that it won't show the navigation bar after hiding it.

Before:

enter image description here

After:

enter image description here

like image 849
bogen Avatar asked Oct 23 '14 08:10

bogen


Video Answer


2 Answers

I had a similar problem where the navigation bar did not show even after I set the hidesBarOnSwipe to NO. Adding the following line fixed it for me (after setting hidesBarOnSwipe to NO)

[[self navigationController] setNavigationBarHidden:NO animated:YES];
like image 127
RawMean Avatar answered Oct 12 '22 12:10

RawMean


I have the same problem with my UIWebView, It's fixed by updating the constrains of my WebView to be relative to the superview not layout guide:

enter image description here

like image 24
Hossam Ghareeb Avatar answered Oct 12 '22 13:10

Hossam Ghareeb