Commit 98bf59d1bb054187d99adfa0d31d944fba2f8afe

Authored by zhangxiaowen
1 parent 2ef7bbf0

no message

CNLiveCustomControl/Classes/WebView/CNLiveWebView.m
@@ -22,8 +22,8 @@ static CGFloat const progressViewHeight = 1; @@ -22,8 +22,8 @@ static CGFloat const progressViewHeight = 1;
22 if (@available(iOS 11, *)) { 22 if (@available(iOS 11, *)) {
23 self.wkWebView.scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentAutomatic; 23 self.wkWebView.scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentAutomatic;
24 } 24 }
25 - [self addSubview:self.progressView];  
26 [self addSubview:self.wkWebView]; 25 [self addSubview:self.wkWebView];
  26 + [self addSubview:self.progressView];
27 } 27 }
28 return self; 28 return self;
29 } 29 }
@@ -164,7 +164,7 @@ static CGFloat const progressViewHeight = 1; @@ -164,7 +164,7 @@ static CGFloat const progressViewHeight = 1;
164 //很重要,如果没有设置这个则不会回调createWebViewWithConfiguration方法,也不会回应window.open()方法 164 //很重要,如果没有设置这个则不会回调createWebViewWithConfiguration方法,也不会回应window.open()方法
165 preferences.javaScriptCanOpenWindowsAutomatically = YES; 165 preferences.javaScriptCanOpenWindowsAutomatically = YES;
166 configuration.preferences = preferences; 166 configuration.preferences = preferences;
167 - _wkWebView = [[WKWebView alloc] initWithFrame:CGRectMake(0, progressViewHeight, self.frame.size.width, self.frame.size.height-progressViewHeight) configuration:configuration]; 167 + _wkWebView = [[WKWebView alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height) configuration:configuration];
168 [_wkWebView.configuration.userContentController addUserScript:noneSelectScript]; 168 [_wkWebView.configuration.userContentController addUserScript:noneSelectScript];
169 _wkWebView.allowsLinkPreview = NO; 169 _wkWebView.allowsLinkPreview = NO;
170 _wkWebView.UIDelegate = self; 170 _wkWebView.UIDelegate = self;