Does the height of the frame of UIWebview change according to the internal html?
My approach is generally to let the webview load HTML first, and then the controller becomes the delegate of the webview. In the webViewDidLoad method, get the height of the webview after loading through js, and then refresh the page. At this time, set the frame for the webView .size.height can be equal to the height you obtained through js before
Does the height of the frame of UIWebview change according to the internal html?
My approach is generally to let the webview load HTML first, and then the controller becomes the delegate of the webview.
In the webViewDidLoad method, get the height of the webview after loading through js, and then refresh the page. At this time, set the frame for the webView .size.height can be equal to the height you obtained through js before
_webViewHeight = [[webView stringByEvaluatingJavaScriptFromString:@"document.body.offsetHeight"] floatValue];