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,6 +27,8 @@ enum CNLiveIntegralPayStatus { | ||
| 27 | } | 27 | } |
| 28 | typealias integralStatusChangeBlock = (_ integralPayStatus:CNLiveIntegralPayStatus) -> Void | 28 | typealias integralStatusChangeBlock = (_ integralPayStatus:CNLiveIntegralPayStatus) -> Void |
| 29 | 29 | ||
| 30 | +let integralAlertToolTag = 10000 | ||
| 31 | + | ||
| 30 | class CNLiveIntegralAlertTool:NSObject{ | 32 | class CNLiveIntegralAlertTool:NSObject{ |
| 31 | static let shared = CNLiveIntegralAlertTool() | 33 | static let shared = CNLiveIntegralAlertTool() |
| 32 | 34 | ||
| @@ -61,7 +63,7 @@ class CNLiveIntegralAlertTool:NSObject{ | @@ -61,7 +63,7 @@ class CNLiveIntegralAlertTool:NSObject{ | ||
| 61 | bottomBgView.backgroundColor = HexColor("#FFFFFF") | 63 | bottomBgView.backgroundColor = HexColor("#FFFFFF") |
| 62 | bottomBgView.layer.cornerRadius = 9 | 64 | bottomBgView.layer.cornerRadius = 9 |
| 63 | bottomBgView.layer.maskedCorners = [.layerMinXMinYCorner, .layerMaxXMinYCorner] | 65 | bottomBgView.layer.maskedCorners = [.layerMinXMinYCorner, .layerMaxXMinYCorner] |
| 64 | - bottomBgView.tag = 10000 | 66 | + bottomBgView.tag = integralAlertToolTag |
| 65 | return bottomBgView | 67 | return bottomBgView |
| 66 | }() | 68 | }() |
| 67 | 69 | ||
| @@ -181,7 +183,7 @@ class CNLiveIntegralAlertTool:NSObject{ | @@ -181,7 +183,7 @@ class CNLiveIntegralAlertTool:NSObject{ | ||
| 181 | //隐藏积分购买弹窗 | 183 | //隐藏积分购买弹窗 |
| 182 | func hiddenIntegralAlert(){ | 184 | func hiddenIntegralAlert(){ |
| 183 | delegate.window?.subviews.forEach({ view in | 185 | delegate.window?.subviews.forEach({ view in |
| 184 | - if view.tag == 10000{ | 186 | + if view.tag == integralAlertToolTag{ |
| 185 | UIView.animate(withDuration: 0.25) { | 187 | UIView.animate(withDuration: 0.25) { |
| 186 | view.removeFromSuperview() | 188 | view.removeFromSuperview() |
| 187 | self.bgBtnView.removeFromSuperview() | 189 | self.bgBtnView.removeFromSuperview() |
metaCode/Classes/Main/HomePage/Controller/AuthMainController/CNMetaCodeHomePageController.swift
| @@ -535,7 +535,7 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel | @@ -535,7 +535,7 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel | ||
| 535 | } | 535 | } |
| 536 | func customIndexViewDidEndScroll(scrollView: UIScrollView) { | 536 | func customIndexViewDidEndScroll(scrollView: UIScrollView) { |
| 537 | print("EndScroll\(scrollView.contentOffset.y)") | 537 | print("EndScroll\(scrollView.contentOffset.y)") |
| 538 | - | 538 | + |
| 539 | if scrollView.contentOffset.y == 0{//下滑页 | 539 | if scrollView.contentOffset.y == 0{//下滑页 |
| 540 | self.tabBarController?.tabBar.isHidden = true | 540 | self.tabBarController?.tabBar.isHidden = true |
| 541 | vNumPage = .VNumPageDown | 541 | vNumPage = .VNumPageDown |
metaCode/Classes/Main/HomePage/View/VerticalViews/CNCustomIndexView.swift
| @@ -311,8 +311,37 @@ class CNCustomIndexView:PGIndexBannerSubiew, UIScrollViewDelegate, WJColorChange | @@ -311,8 +311,37 @@ class CNCustomIndexView:PGIndexBannerSubiew, UIScrollViewDelegate, WJColorChange | ||
| 311 | /**隐藏左右view*/ | 311 | /**隐藏左右view*/ |
| 312 | let fabsOffset: CGFloat = abs(defaultOffset - currentOffset) | 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 | if fabsOffset > 70 { | 345 | if fabsOffset > 70 { |
| 317 | leftView?.alpha = 0 | 346 | leftView?.alpha = 0 |
| 318 | rightView?.alpha = 0 | 347 | rightView?.alpha = 0 |