【发布时间】:2018-02-13 05:09:01
【问题描述】:
我正在 iOS 中开发屏幕测试应用程序,我想在用户滑动并点击手指时隐藏所有 CollectionViewCell。 我使用过 touchesBegan、touchesMoved、touchesEnded 方法,但没有奏效。也对其他逻辑开放。
下面是 CollectionView 的截图。
【问题讨论】:
-
“滑动和点击手指”同时?
-
Yes for tap do select is there, I want both together
-
“用户滑动” - 什么样的?水平垂直?火种类型?
-
所有方向上、下、左、右
-
要处理这种情况,你需要在UICollectionView上创建UITapGesture,而点击滚动控制器(UITableView,UICollection)不会调用touchesBegan方法。因为它们有自己的选择器方法。这是指导您的链接,如何在 UICollectionView 上创建 Tap Gesture,借助此您还将获得另一个手势想法。 useyourloaf.com/blog/collection-view-default-gestures
标签: ios uicollectionview autolayout swift4