Commit 8e85e45f82091b7154efab9e08a97eabb0c01de7
1 parent
df8caf8b
no message
Showing
1 changed file
with
9 additions
and
2 deletions
CNLiveScioLive/Pages/Live/Controller/GraphicLiveViewController.m
| ... | ... | @@ -316,6 +316,15 @@ |
| 316 | 316 | // 页面加载完成之后调用 |
| 317 | 317 | - (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation |
| 318 | 318 | { |
| 319 | + CGRect frame = relatedWebView.frame; | |
| 320 | + frame.size.width = MainScreenWidth; | |
| 321 | + frame.size.height = 1; | |
| 322 | + relatedWebView.frame = frame; | |
| 323 | + [webView evaluateJavaScript:@"document.body.scrollHeight"completionHandler:^(id _Nullable result,NSError * _Nullable error){ | |
| 324 | + NSLog(@"scrollHeight高度:%.2f",[result floatValue]); | |
| 325 | + descriptionHeight = [result floatValue]; | |
| 326 | + [relatedWebView setFrame:CGRectMake(0, 0, MainScreenWidth, descriptionHeight)]; | |
| 327 | + }]; | |
| 319 | 328 | |
| 320 | 329 | if (![[Reachability reachabilityForInternetConnection] currentReachabilityStatus]) { |
| 321 | 330 | [self setUpUIWithTag:webView.tag Height:0]; |
| ... | ... | @@ -416,8 +425,6 @@ |
| 416 | 425 | "}" |
| 417 | 426 | "}\";" |
| 418 | 427 | "document.getElementsByTagName('head')[0].appendChild(script);",width]; |
| 419 | -// [_webView stringByEvaluatingJavaScriptFromString:string]; | |
| 420 | -// [_webView stringByEvaluatingJavaScriptFromString:@"ResizeImages();"]; | |
| 421 | 428 | |
| 422 | 429 | [_webView evaluateJavaScript:string completionHandler:nil]; |
| 423 | 430 | [_webView evaluateJavaScript:@"ResizeImages();" completionHandler:nil]; | ... | ... |