fix(WKWebView Scrolling): fixed broken scroll

fixes #371
This commit is contained in:
Thibault Malbranche 2019-03-01 10:44:57 +01:00 committed by GitHub
parent 211ae18971
commit ef01c50914
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 8 deletions

View File

@ -341,19 +341,14 @@ static NSURLCredential* clientAuthenticationCredential;
{
_scrollEnabled = scrollEnabled;
_webView.scrollView.scrollEnabled = scrollEnabled;
// Override the scrollView delegate to prevent scrolling.
if (!scrollEnabled) {
_webView.scrollView.delegate = self;
} else {
_webView.scrollView.delegate = _webView;
}
}
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
// Don't allow scrolling the scrollView.
scrollView.bounds = _webView.bounds;
if (!_scrollEnabled) {
scrollView.bounds = _webView.bounds;
}
}
- (void)setShowsHorizontalScrollIndicator:(BOOL)showsHorizontalScrollIndicator