I\'m currently using webView to display news,below the news I intend to put some buttons.so I need to get the height of webView so as to change the position of buttons accor
try this
- (void)webViewDidFinishLoad:(UIWebView *)webView
{
NSString *string = [_webView stringByEvaluatingJavaScriptFromString:@"document.getElementById(\"body\").offsetHeight;"];
CGFloat height = [string floatValue] + 8;
CGRect frame = [_webView frame];
frame.size.height = height;
[_webView setFrame:frame];
if ([[self delegate] respondsToSelector:@selector(webViewController:webViewDidResize:)])
{
[[self delegate] webViewController:self webViewDidResize:frame.size];
}
}