Pull down UIToolbar above UIWebView inside UIScrollView

Posted by Nick VanderPyle on Stack Overflow See other posts from Stack Overflow or by Nick VanderPyle
Published on 2010-04-28T16:40:28Z Indexed on 2010/04/28 16:43 UTC
Read the original article Hit count: 345

I'd like to display a toolbar above a UIWebView but hide the toolbar until the person "pulls it down".

The same functionality can be seen in Safari on the iPhone. When the page loads, the toolbar containing the address is hidden. You must pull it down. In Safari it's possible to scroll up and eventually see the toolbar or scroll down through the page contents.

I've tried placing a UIToolbar and UIWebView inside a UIScrollView but it didn't work. I've tried setting the UIScrollView to the size of the toolbar and webview combined, but that didn't work.

- (void)viewDidLoad{
    CGSize size = CGSizeMake(webView.frame.size.width,
                              toolBar.frame.size.height + webView.frame.size.height);
    [scrollView setContentSize:size];
}

How should I go about doing this?

© Stack Overflow or respective owner

Related posts about cocoa-touch

Related posts about uiscrollview