I am creating on an application using Objective C, where I'm using a UIWebView
to display contents in HTML format. I am using below code in UIWebView
delegate method webViewDidFinishLoad
NSUInteger contentHeight = [[aWebView stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"document.body.scrollHeight;"]] intValue];
to calculate the webview content height, this is working fine in iOS8
, iOS9
and iOS11
but in iOS10
iPhone mobiles the content height returning a much bigger value than the actual content value. Because of this, I am getting some extra white space in bottom of my webview in screen.
I tried all the solutions but getting the same wrong content height only in iOS 10. Please help me to resolve this problem. Thank You in Advance!