Increase content size of UIWebView using Javascript
- by Sam
Hi folks,
I have a translucent toolbar over the bottom of my UIWebView. The trouble is, if there is a link at the bottom of the page, I can't press it because the webview will always bounce back down to the bottom.
I don't want to shrink the webview and use a solid colour toolbar, and UIWebViews interface doesn't open much up.
What I would like to do, ideally, is to actually increase the size of the web page by one toolbar height, so that I can scroll that extra bit and have all the content above the toolbar, but when scrolling down I will be able to see the page content through the toolbar. I could use the stringByEvaluatingJavaScriptFromString: function of UIWebView.
I'm very rusty on JavaScript- is it possible for me to do this? Increase the window height or something?
I tried:
[webView stringByEvaluatingJavaScriptFromString: [NSString stringWithFormat:@"window.resizeBy(0,%d);", TOOLBAR_HEIGHT] ];
but it didn't do anything.
Any pointers welcome.
Thanks.