4

I want to hide the address bar when I scroll in a UIWebView like in Safari so when the user scrolls down on the webpage, the menu bar gets pushed up so that the user can see the whole page like in Safari.

Anyone suggestions and/or tutorials?

Thanks in advance!

Jonathan Sterling
  • 18,320
  • 12
  • 67
  • 79
CyberK
  • 1,568
  • 3
  • 31
  • 44
  • There's a framework called `WebKit` and a class called `UIWebView`, but as far as I know, nothing called `UIWebKit`. I've edited the title, but if I was mistaken, my apologies. – Jonathan Sterling Dec 12 '10 at 04:33

3 Answers3

2

Late answare, but if somebody needs this.

You can detect the scroll very easy. UIWebView conforms with UIScrollViewDelegate.

[webView.scrollView setDelegate:self];

and add method:

- (void) scrollViewDidScroll:(UIScrollView *)scrollView {
      if(scrollView.contentOffset.y == 0) {
          //show
      } else {
          //hide
      }
}
Cornel Damian
  • 733
  • 8
  • 11
0

Nothing stops you putting a UINavigationBar inside a UIScrollView with the UIWebView. Maybe that's over complicating it - but it will give the effect you are looking for.

Lee
  • 2,204
  • 13
  • 15
0

You can use this tutorial to detect scrolling. Then you can hide your address bar (I don't believe UIWebView includes one) when you detect the user scrolling.

arsenius
  • 12,090
  • 7
  • 58
  • 76