Commit b35b13d72f876d4ff2ab281cc29879717542f3b8
1 parent
5681b5f5
提交0.0.22_更改网页偏移问题
Showing
2 changed files
with
14 additions
and
2 deletions
CNLiveServiceCenterModule.podspec
CNLiveServiceCenterModule/Classes/CNLiveServiceCenterModule/Controller/CNLiveBCreatorViewController.m
| ... | ... | @@ -61,9 +61,10 @@ |
| 61 | 61 | [self.view addSubview:progress]; |
| 62 | 62 | self.progressView = progress; |
| 63 | 63 | |
| 64 | + self.extendedLayoutIncludesOpaqueBars = YES; | |
| 64 | 65 | |
| 65 | 66 | self.view.backgroundColor = [UIColor whiteColor]; |
| 66 | - WKWebView *webView = [[WKWebView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, KScreenHeight)]; | |
| 67 | + WKWebView *webView = [[WKWebView alloc] initWithFrame:CGRectMake(0, kNavigationBarHeight, kScreenWidth, KScreenHeight - kNavigationBarHeight)]; | |
| 67 | 68 | [self.view addSubview:webView]; |
| 68 | 69 | webView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight; |
| 69 | 70 | [webView addObserver:self forKeyPath:@"estimatedProgress" options:NSKeyValueObservingOptionNew context:nil]; |
| ... | ... | @@ -78,6 +79,17 @@ |
| 78 | 79 | |
| 79 | 80 | self.wkwebView = webView; |
| 80 | 81 | |
| 82 | + if (@available(iOS 11.0, *)) { | |
| 83 | + | |
| 84 | + self.wkwebView.scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; | |
| 85 | + | |
| 86 | + } else { | |
| 87 | + | |
| 88 | + self.automaticallyAdjustsScrollViewInsets = NO; | |
| 89 | + | |
| 90 | + } | |
| 91 | + | |
| 92 | + | |
| 81 | 93 | } |
| 82 | 94 | |
| 83 | 95 | - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSKeyValueChangeKey,id> *)change context:(void *)context{ | ... | ... |