我在View中添加了UIWebView,在ScrollView中添加了该视图.
我想得到UIWebView内容的框架.那么我可以设置框架来查看和滚动查看吗?
我知道我们可以通过使用javascript获得高度.如下所述:
float height = [[webView stringByEvaluatingJavaScriptFromString:@"document.body.offsetHeight;"] floatValue];
Run Code Online (Sandbox Code Playgroud)
但是当我旋转视图并重新计算didRotateFromInterfaceOrientation::(UIInterfaceOrientation)fromInterfaceOrientation方法中UIWebView内容的高度时,内容高度增加了.
所以请建议我在旋转方向时如何获得合适的高度?
谢谢.