I have a UIWebView that is sandwiched in between a UINavigationController (top) and a UIToolbar (bottom). When the user taps twice on the UIWebView, I want to smoothly animate the top and bottom bars to hide. However, when I use this code (and several other different variations of this concept), the bar hides fine, but sometimes (sometimes not) the UIWebView content scrolls up 20-30px:
[self.navigationController setNavigationBarHidden:YES animated:YES];
It works sometimes, and then other times it doesn’t. I just want to be able to smoothly hide/unhide both bars, changing the UIWebView size to full screen/not full screen as I go.
Anybody done this? Or know what is going on here?
make your
UINavigationBartranslucantin your
viewWillAppearmethod.