UIWebView加载不同的URL,仅获取最大contentSize,如何获取当前URL contentSize

时间:2018-09-04 08:48:56

标签: uiwebview contentsize intrinsic-content-size

我陷入了困境,UIWebView加载了不同的URL,如何获取每个URL的contentSize ...

- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSKeyValueChangeKey,id> *)change context:(void *)context {
    if (![keyPath isEqualToString:@"contentSize"]) return;
    CGSize vWebContentSize = [self.vcWeb.vWeb.wvBaseMain sizeThatFits:CGSizeZero];
    self.vcWeb.view.height = vWebContentSize.height;
    [self updateContainerContentSize];
}

0 个答案:

没有答案