zoukankan      html  css  js  c++  java
  • Swift UITableView嵌套UICollectionView点击事件冲突(点击事件穿透)

    不管是啥都响应tableviewcell

    class JYShopCertificationCell: UITableViewCell {    
    
            override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
            return self
            }
    
    }

    2.只穿透UICollectionView

        override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {

            let view = super.hitTest(point, with: event)

            

            if let isBtn = view?.isKind(of: UICollectionView.self) {

                if isBtn == true, view?.tag == 100{

                    return self

                }

            }

            return view

        }

    https://www.jianshu.com/p/4424ebd567d6

  • 相关阅读:
    javascript --学习this
    seaJS
    wamp之htaccess的配置
    replace之$1、$2等
    nw.js使用
    新电脑开发环境配置
    vue-vue常用指令
    Array的splice与slice
    vue-入门体验
    Object.defineProperty
  • 原文地址:https://www.cnblogs.com/qingzZ/p/10694451.html
Copyright © 2011-2022 走看看