【发布时间】:2014-12-13 00:04:01
【问题描述】:
override func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
// initialize cell
if let pickerCell = cell as? SettingsPickerCell {
collectionView.panGestureRecognizer.requireGestureRecognizerToFail(pickerCell.picker.collectionViewController.collectionView!.panGestureRecognizer)
}
return cell
}
上面的代码可以工作,虽然丑得要命。我有一个隐藏在视图层次结构中的 scrollView,我需要一种更好的方法来在选择器滚动时禁用集合视图滚动。
我尝试使用 exclusiveTouch 属性,但没有帮助。还有比这更好的方法吗?
【问题讨论】:
-
这与this answer有关吗?
-
@wmorrison365 我不这么认为,因为我的问题是对该 OP 的回答。此外,寻找的解决方案可能是使用我发布的相同想法的更好的设计模式。
标签: ios uiscrollview uikit uigesturerecognizer