本文主要是介绍【iOS】UIScrollview联动,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
直接上代码
class CustomScrollview: UIScrollView {override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {switch event?.type {case .touches:print("touch")default:return super.hitTest(point, with: event)}guard let v = super.hitTest(point, with: event) else {return nil}if v.isKind(of: UIScrollView.self) {return v}if (contentOffset.y + bounds.height) >= contentSize.height {return nil}return v}
}
这篇关于【iOS】UIScrollview联动的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!