Commit 9b562ea2b9c330ebf9f11a63417dc0b1f7ef2b86
1 parent
5dea2890
认证 上滑后偶尔左右视图不隐藏问题
Showing
3 changed files
with
36 additions
and
5 deletions
metaCode/Classes/Common/Util/CNLiveIntegralAlertTool.swift
| ... | ... | @@ -27,6 +27,8 @@ enum CNLiveIntegralPayStatus { |
| 27 | 27 | } |
| 28 | 28 | typealias integralStatusChangeBlock = (_ integralPayStatus:CNLiveIntegralPayStatus) -> Void |
| 29 | 29 | |
| 30 | +let integralAlertToolTag = 10000 | |
| 31 | + | |
| 30 | 32 | class CNLiveIntegralAlertTool:NSObject{ |
| 31 | 33 | static let shared = CNLiveIntegralAlertTool() |
| 32 | 34 | |
| ... | ... | @@ -61,7 +63,7 @@ class CNLiveIntegralAlertTool:NSObject{ |
| 61 | 63 | bottomBgView.backgroundColor = HexColor("#FFFFFF") |
| 62 | 64 | bottomBgView.layer.cornerRadius = 9 |
| 63 | 65 | bottomBgView.layer.maskedCorners = [.layerMinXMinYCorner, .layerMaxXMinYCorner] |
| 64 | - bottomBgView.tag = 10000 | |
| 66 | + bottomBgView.tag = integralAlertToolTag | |
| 65 | 67 | return bottomBgView |
| 66 | 68 | }() |
| 67 | 69 | |
| ... | ... | @@ -181,7 +183,7 @@ class CNLiveIntegralAlertTool:NSObject{ |
| 181 | 183 | //隐藏积分购买弹窗 |
| 182 | 184 | func hiddenIntegralAlert(){ |
| 183 | 185 | delegate.window?.subviews.forEach({ view in |
| 184 | - if view.tag == 10000{ | |
| 186 | + if view.tag == integralAlertToolTag{ | |
| 185 | 187 | UIView.animate(withDuration: 0.25) { |
| 186 | 188 | view.removeFromSuperview() |
| 187 | 189 | self.bgBtnView.removeFromSuperview() | ... | ... |
metaCode/Classes/Main/HomePage/Controller/AuthMainController/CNMetaCodeHomePageController.swift
| ... | ... | @@ -535,7 +535,7 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel |
| 535 | 535 | } |
| 536 | 536 | func customIndexViewDidEndScroll(scrollView: UIScrollView) { |
| 537 | 537 | print("EndScroll\(scrollView.contentOffset.y)") |
| 538 | - | |
| 538 | + | |
| 539 | 539 | if scrollView.contentOffset.y == 0{//下滑页 |
| 540 | 540 | self.tabBarController?.tabBar.isHidden = true |
| 541 | 541 | vNumPage = .VNumPageDown | ... | ... |
metaCode/Classes/Main/HomePage/View/VerticalViews/CNCustomIndexView.swift
| ... | ... | @@ -311,8 +311,37 @@ class CNCustomIndexView:PGIndexBannerSubiew, UIScrollViewDelegate, WJColorChange |
| 311 | 311 | /**隐藏左右view*/ |
| 312 | 312 | let fabsOffset: CGFloat = abs(defaultOffset - currentOffset) |
| 313 | 313 | |
| 314 | - let leftView:UIView? = self.superScrollView?.viewWithTag(tag-1) | |
| 315 | - let rightView:UIView? = self.superScrollView?.viewWithTag(tag+1) | |
| 314 | + var leftView:CNCustomIndexView? = self.superScrollView?.viewWithTag(tag-1) as? CNCustomIndexView | |
| 315 | + var rightView:CNCustomIndexView? = self.superScrollView?.viewWithTag(tag+1) as? CNCustomIndexView | |
| 316 | + if leftView == nil{ | |
| 317 | + if let haveSub = self.superScrollView?.subviews.filter({ tempLeftView in | |
| 318 | + if tempLeftView is CNCustomIndexView && tempLeftView.tag == tag-1{ | |
| 319 | + leftView = (tempLeftView as! CNCustomIndexView) | |
| 320 | + return true | |
| 321 | + }else{ | |
| 322 | + return false | |
| 323 | + } | |
| 324 | + }){ | |
| 325 | +// print("leftView\(leftView)") | |
| 326 | + }else{ | |
| 327 | + | |
| 328 | + } | |
| 329 | + } | |
| 330 | + if rightView == nil{ | |
| 331 | + if let haveSub = self.superScrollView?.subviews.filter({ tempRightView in | |
| 332 | + if tempRightView is CNCustomIndexView && tempRightView.tag == tag+1{ | |
| 333 | + rightView = (tempRightView as! CNCustomIndexView) | |
| 334 | + return true | |
| 335 | + }else{ | |
| 336 | + return false | |
| 337 | + } | |
| 338 | + }){ | |
| 339 | +// print("rightView\(rightView)") | |
| 340 | + }else{ | |
| 341 | + | |
| 342 | + } | |
| 343 | + } | |
| 344 | + | |
| 316 | 345 | if fabsOffset > 70 { |
| 317 | 346 | leftView?.alpha = 0 |
| 318 | 347 | rightView?.alpha = 0 | ... | ... |