Commit 2e6e128c804376a6b2cd80e3244efb09b10ecd52
1 parent
13173d1c
暂时把downView高度减少10 , 应对白条问题
Showing
3 changed files
with
10 additions
and
4 deletions
metaCode/Classes/Main/HomePage/View/CNCustomIndexView.swift
| @@ -168,6 +168,7 @@ class CNCustomIndexView:PGIndexBannerSubiew, UIScrollViewDelegate, WJColorChange | @@ -168,6 +168,7 @@ class CNCustomIndexView:PGIndexBannerSubiew, UIScrollViewDelegate, WJColorChange | ||
| 168 | ///下滑显示的VIew | 168 | ///下滑显示的VIew |
| 169 | lazy var downSlideView: CNDownSlideView = { | 169 | lazy var downSlideView: CNDownSlideView = { |
| 170 | let collectionView = CNDownSlideView.init(frame: CGRectMake(-25, 0, self.frame.size.width + 50, self.frame.size.height)) | 170 | let collectionView = CNDownSlideView.init(frame: CGRectMake(-25, 0, self.frame.size.width + 50, self.frame.size.height)) |
| 171 | + collectionView.backgroundColor = .clear | ||
| 171 | collectionView.backAction = {[weak self] in | 172 | collectionView.backAction = {[weak self] in |
| 172 | self?.baseScrollView.setContentOffset(CGPoint(x: 0, y: (self!.baseScrollView.height)), animated: true) | 173 | self?.baseScrollView.setContentOffset(CGPoint(x: 0, y: (self!.baseScrollView.height)), animated: true) |
| 173 | self?.superScrollView?.isScrollEnabled = true | 174 | self?.superScrollView?.isScrollEnabled = true |
metaCode/Classes/Main/HomePage/View/CNDownSlideView.swift
| @@ -37,10 +37,13 @@ class CNDownSlideView:UIView{ | @@ -37,10 +37,13 @@ class CNDownSlideView:UIView{ | ||
| 37 | }() | 37 | }() |
| 38 | 38 | ||
| 39 | //h5网页 | 39 | //h5网页 |
| 40 | + // TODO: H:-10原为self.height-KTabBarHeight,但有白条,改成了-10 | ||
| 40 | lazy var webView: WKWebView = { | 41 | lazy var webView: WKWebView = { |
| 41 | - let webView = WKWebView.init(frame: CGRectMake(0, 0, self.width, self.height-KTabBarHeight)) | 42 | + let webView = WKWebView.init(frame: CGRectMake(0, 0, self.width, self.height-KTabBarHeight-10)) |
| 42 | webView.scrollView.showsVerticalScrollIndicator = false | 43 | webView.scrollView.showsVerticalScrollIndicator = false |
| 43 | webView.scrollView.showsHorizontalScrollIndicator = false | 44 | webView.scrollView.showsHorizontalScrollIndicator = false |
| 45 | + webView.backgroundColor = .clear | ||
| 46 | + webView.isOpaque = false | ||
| 44 | return webView | 47 | return webView |
| 45 | }() | 48 | }() |
| 46 | 49 | ||
| @@ -51,7 +54,7 @@ class CNDownSlideView:UIView{ | @@ -51,7 +54,7 @@ class CNDownSlideView:UIView{ | ||
| 51 | } | 54 | } |
| 52 | set{ | 55 | set{ |
| 53 | _url = newValue! | 56 | _url = newValue! |
| 54 | -// _url = "https://www.baidu.com" | 57 | + _url = "https://www.baidu.com" |
| 55 | if (_url != ""){ | 58 | if (_url != ""){ |
| 56 | let webUrl: URL! = URL.init(string: _url!) | 59 | let webUrl: URL! = URL.init(string: _url!) |
| 57 | webView.load(URLRequest.init(url:webUrl)) | 60 | webView.load(URLRequest.init(url:webUrl)) |
| @@ -107,9 +110,10 @@ class CNDownSlideView:UIView{ | @@ -107,9 +110,10 @@ class CNDownSlideView:UIView{ | ||
| 107 | ///初始化UI | 110 | ///初始化UI |
| 108 | func initUI(){ | 111 | func initUI(){ |
| 109 | self.addSubview(self.contentView) | 112 | self.addSubview(self.contentView) |
| 110 | - self.addSubview(self.topView) | ||
| 111 | - self.addSubview(self.bottomView) | ||
| 112 | self.contentView.addSubview(self.webView) | 113 | self.contentView.addSubview(self.webView) |
| 114 | +// self.addSubview(self.topView) | ||
| 115 | + self.addSubview(self.bottomView) | ||
| 116 | + | ||
| 113 | } | 117 | } |
| 114 | 118 | ||
| 115 | @objc func backBtnAction(){ | 119 | @objc func backBtnAction(){ |
metaCode/Classes/Main/HomePage/View/CNUpSlideView.swift
| @@ -15,6 +15,7 @@ class CNUpSlideView:UIView{ | @@ -15,6 +15,7 @@ class CNUpSlideView:UIView{ | ||
| 15 | let webView = WKWebView.init(frame: CGRectMake(10, 20, self.width - 20, self.height - 20)) | 15 | let webView = WKWebView.init(frame: CGRectMake(10, 20, self.width - 20, self.height - 20)) |
| 16 | webView.scrollView.showsVerticalScrollIndicator = false | 16 | webView.scrollView.showsVerticalScrollIndicator = false |
| 17 | webView.scrollView.showsHorizontalScrollIndicator = false | 17 | webView.scrollView.showsHorizontalScrollIndicator = false |
| 18 | + webView.backgroundColor = .clear | ||
| 18 | return webView | 19 | return webView |
| 19 | }() | 20 | }() |
| 20 | 21 |