Merge pull request #85 from omnivore-app/fix/webview-scroll-offset

Set the scroll indicator offsets on the webview
This commit is contained in:
Jackson Harper 2022-02-19 01:35:40 +08:00 committed by GitHub
commit 20e8029f2d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -29,12 +29,13 @@ import WebKit
let webView = WebView(frame: CGRect.zero)
let contentController = WKUserContentController()
webView.scrollView.contentInset.top = LinkItemDetailView.navBarHeight
webView.navigationDelegate = context.coordinator
webView.isOpaque = false
webView.backgroundColor = UIColor.clear
webView.configuration.userContentController = contentController
webView.scrollView.delegate = context.coordinator
webView.scrollView.contentInset.top = LinkItemDetailView.navBarHeight
webView.scrollView.verticalScrollIndicatorInsets = UIEdgeInsets(top: LinkItemDetailView.navBarHeight, left: 0, bottom: 0, right: 0)
for action in WebViewAction.allCases {
webView.configuration.userContentController.add(context.coordinator, name: action.rawValue)