Commit 98bf59d1bb054187d99adfa0d31d944fba2f8afe
1 parent
2ef7bbf0
no message
Showing
1 changed file
with
2 additions
and
2 deletions
CNLiveCustomControl/Classes/WebView/CNLiveWebView.m
| ... | ... | @@ -22,8 +22,8 @@ static CGFloat const progressViewHeight = 1; |
| 22 | 22 | if (@available(iOS 11, *)) { |
| 23 | 23 | self.wkWebView.scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentAutomatic; |
| 24 | 24 | } |
| 25 | - [self addSubview:self.progressView]; | |
| 26 | 25 | [self addSubview:self.wkWebView]; |
| 26 | + [self addSubview:self.progressView]; | |
| 27 | 27 | } |
| 28 | 28 | return self; |
| 29 | 29 | } |
| ... | ... | @@ -164,7 +164,7 @@ static CGFloat const progressViewHeight = 1; |
| 164 | 164 | //很重要,如果没有设置这个则不会回调createWebViewWithConfiguration方法,也不会回应window.open()方法 |
| 165 | 165 | preferences.javaScriptCanOpenWindowsAutomatically = YES; |
| 166 | 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 | 168 | [_wkWebView.configuration.userContentController addUserScript:noneSelectScript]; |
| 169 | 169 | _wkWebView.allowsLinkPreview = NO; |
| 170 | 170 | _wkWebView.UIDelegate = self; | ... | ... |