How can I make the navigation bar hide as the user scrolls? I'm trying to implement a browser like the Safari Mobile app.
note:
I'm using UIWebView and not a UIScrollView.
How can I make the navigation bar hide as the user scrolls? I'm trying to implement a browser like the Safari Mobile app.
note:
I'm using UIWebView and not a UIScrollView.
The standard approach used to be to add your view as a subview of the webview, and change the webview's contentInset property to shift everything in the webview downwards. I'm not sure if that still works with iOS 4.3.
Alternatively, if you search on SO, you'll find lots of questions the same as this one, with a variety of answers that may work, e.g.:
How to set content offset and content size in a UIWebView
iphone: View on top of UIWebView?
If you are using a UIScrollView then you can hide navigation bar in scroll view's delegate-
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
[self.navigationController.navigationBar setHidden:TRUE];
}
Put the navigation bar inside the scroll view. In other words, make the scrollview your view controllers view.