Collection View 不称为 didSelectItemAtIndexPath
。当我将点击手势识别器添加到 collectionView
super View 时,它总是响应点击手势方法。
请帮助我,在此先感谢!
试试这个
func gestureRecognizer(gestureRecognizer: UIGestureRecognizer, shouldReceiveTouch touch: UITouch) -> Bool {
let touchPoint = touch.locationInView(superView)
return !CGRectContainsPoint(collectionView.frame, touchPoint)
}
并确保代理已连接:
tapGestureRecognizer.delegate = self
关于ios - UICollectionView:将点击手势识别器添加到 collectionView super View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38009292/
欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://jike.in/) | Powered by Discuz! X3.4 |