我有一个UICollectionView,大小和屏幕差不多.它显示的UICollectionViewCells与collectionView的大小相同.每个单元格都有一个UIImage,它是单元格的大小.CollectionView启用了分页功能,因此本质上是一个全屏照片幻灯片,用户可以在其中滑动.

The problem is that
-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath is only being called if the user taps with two fingers on a cell or long presses with one finger and then releases. It does not seem to have the default behaviour of single tap selection. I have not made any changes to the CollectionView gesture recognizer so am having trouble finding a solution to this problem.

推荐答案

你确定你没有意外地超过- (void)collectionView:(UICollectionView *)collectionView didDeselectItemAtIndexPath:(NSIndexPath *)indexPath吗?" Select "和"取消 Select "在过go 的Xcode代码完成过程中让我绊倒了.

Objective-c相关问答推荐

恢复 iOS7 之前的 UINavigationController pushViewController 动画

NSNumberFormatter 和 'th' 'st' 'nd' 'rd' (序数)数字结尾

UITableViewCell:如何防止蓝色 Select ​​背景不带 isSelected 属性?

Objective C 中的 RSA 实现

iOS中的非延迟图像加载

如何可靠地检测 iOS 9 上是否连接了外部键盘?

使用 NSArray 初始化对象数组

右对齐的 UITextField 空格键在 iOS 7 中不前进光标

iOS:将 URL 解析为段

iOS 7 状态栏与 NavigationBar 冲突

如何在情节提要场景中嵌入自定义视图 xib?

UITableView configureCellForDisplay:forIndexPath 中的断言失败:

将 NSData 字节转换为 NSString?

当用户点击文本字段外的其他区域时如何关闭键盘?

Xcode:无法判断应用程序包

在 DEBUG 模式下启用和禁用 NSLog

创建 NSTextField标签的示例代码?

NSString 中子字符串的出现次数?

iOS 10 中的错误:无法从 https://mesu.apple.com/assets/ 复制assets资源信息以获取assets资源类型

iOS 上的电话号码格式