美文网首页
UIScrollView 嵌套UITableView 左滑删除和

UIScrollView 嵌套UITableView 左滑删除和

作者: 花漾爱意 | 来源:发表于2022-05-21 11:08 被阅读0次

    UISlider UIControl 和系统右滑手势冲突方案解决

    extension UISlider {
        open override func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool {
            false
        }
    }
    
    
    extension UIControl {
        open override func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool {
            false
        }
    }
    

    UIScrollView 嵌套UITableView 左滑删除和UIScrollView滑动冲突

    // 创建UISCrollView 子类
    class CommonScrollerView: UIScrollView {
        
        override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
            let view = super.hitTest(point, with: event)
            if view?.superview?.superview is VehicleLogTableViewCell {
                self.isScrollEnabled = false
            } else {
                self.isScrollEnabled = true
            }
            return view
        }
    }
    

    相关文章

      网友评论

          本文标题:UIScrollView 嵌套UITableView 左滑删除和

          本文链接:https://www.haomeiwen.com/subject/rakcprtx.html