How to disable scrolling entirely in a WKWebView?

前端 未结 10 1696
再見小時候
再見小時候 2020-12-28 14:07

I know this looks like a simple question one can simply say:

webview.scrollView.scrollEnabled = NO;
webview.scrollView.panGestureRecognizer.enabled = NO;
web         


        
10条回答
  •  甜味超标
    2020-12-28 15:05

    Swift 5

    disableScrollView(self.webView)
    
    func disableScrollView(_ view: UIView) {
        (view as? UIScrollView)?.isScrollEnabled = false
        view.subviews.forEach { disableScrollView($0) }
    }
    

提交回复
热议问题