gliubc
6/14/2018 - 3:28 AM

webViewDidFinishLoad

webViewDidFinishLoad

@interface MachineDetailVC () <UIWebViewDelegate>

@property (weak, nonatomic) IBOutlet UIWebView *webView;

    self.webView.delegate = self;
    
    // @weakify(self);
    // [self.KVOController observe:self.webView.scrollView keyPath:@"contentSize" options:0 block:^(id  _Nullable observer, id  _Nonnull object, NSDictionary<NSKeyValueChangeKey,id> * _Nonnull change) {
    //     @strongify(self);
    //     self.constraintWebViewHeight.constant = self.webView.scrollView.contentSize.height;
    // }];

    // [self.webView loadHTMLString:self.model.goods_desc baseURL:nil];
    [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.bing.com"]]];


- (void)webViewDidFinishLoad:(UIWebView *)webView {
    CGFloat contentHeight =[webView.scrollView contentSize].height;
    self.constraintNoteHeight.constant = contentHeight;
}