Is it possible to set the height of a UIWebView by doing something like this..
[webView.height: currentHeight - 44px];
So essentially, I want to get the height of the UIWebView and then make it 44px shorter from the bottom, programmatically.
Save your old frame like this:
CGRect oldFrame = WebView.frame;
Then set the new frame :
CGRect newFrame =CGRectMake(oldFrame.origin.x, oldFrame.origin.y, oldFrame.size.width, oldFrame.size.height-44);
[WebView setFrame:newFrame];
Thats it :-)
I guess this should be enough.
webView.frame = CGRectMake(webView.frame.origin.x, webView.frame.origin.y, webView.frame.size.width, webView.frame.size.height - 44);
来源:https://stackoverflow.com/questions/14868668/height-of-uiwebview-minus-44px-programmatically