From 62a24b3c7cf92919a93ee575e9460037e1a53816 Mon Sep 17 00:00:00 2001 From: 杨锴 <841720330@qq.com> Date: 星期四, 07 十一月 2024 19:10:20 +0800 Subject: [PATCH] fix bug --- XQMuse/Root/Other/WebVC.swift | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/XQMuse/Root/Other/WebVC.swift b/XQMuse/Root/Other/WebVC.swift index f463d3d..7cae9d2 100644 --- a/XQMuse/Root/Other/WebVC.swift +++ b/XQMuse/Root/Other/WebVC.swift @@ -54,7 +54,7 @@ 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() }) @@ -64,6 +64,7 @@ self.automaticallyAdjustsScrollViewInsets = false } + webView!.scrollView.delegate = self progressView.tintColor = tintColor view.addSubview(progressView) @@ -109,3 +110,12 @@ } } + +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 + } +} -- Gitblit v1.7.1