| | |
| | | webView?.addObserver(self, forKeyPath: "estimatedProgress", options: .new, context: nil) |
| | | view.addSubview(webView!) |
| | | webView?.snp.makeConstraints({ (make) in |
| | | make.top.equalToSuperview() |
| | | make.top.equalToSuperview().offset(UIDevice.jq_safeEdges.top) |
| | | make.left.right.bottom.equalToSuperview() |
| | | }) |
| | | |
| | |
| | | self.automaticallyAdjustsScrollViewInsets = false |
| | | } |
| | | |
| | | webView!.scrollView.delegate = self |
| | | |
| | | progressView.tintColor = tintColor |
| | | view.addSubview(progressView) |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | extension WebVC:UIScrollViewDelegate{ |
| | | func scrollViewDidScroll(_ scrollView: UIScrollView) { |
| | | // let v = min(scrollView.contentOffset.y / JQ_NavBarHeight, 1) |
| | | // navigationController?.navigationBar.standardAppearance.backgroundColor = .white.withAlphaComponent(v) |
| | | navigationController?.navigationBar.standardAppearance.backgroundColor = .white |
| | | navigationController?.navigationBar.scrollEdgeAppearance?.backgroundColor = .white |
| | | } |
| | | } |