Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Swift UICollectionView取消全部选择_Swift_Uicollectionview - Fatal编程技术网

Swift UICollectionView取消全部选择

Swift UICollectionView取消全部选择,swift,uicollectionview,Swift,Uicollectionview,使用didSelectItemAtIndexPath处理选择时,是否必须确保使用 cell.select = true 为了让IndExpathForSelectedItems工作 我有一个collectionview,当在“编辑模式”中选择时,我会在每个缩略图周围创建一个红色框 我想在按下“完成”时清除这些框 调用indexPathsForSelectedItems只返回一个值,我不知道为什么?(我已尝试设置cell=selected,但仍然只返回一次)。在您的收藏视图中将允许Multipl

使用didSelectItemAtIndexPath处理选择时,是否必须确保使用

cell.select = true
为了让IndExpathForSelectedItems工作

我有一个collectionview,当在“编辑模式”中选择时,我会在每个缩略图周围创建一个红色框

我想在按下“完成”时清除这些框


调用indexPathsForSelectedItems只返回一个值,我不知道为什么?(我已尝试设置cell=selected,但仍然只返回一次)。

在您的收藏视图中将
允许MultipleSelection
设置为true。

感谢您在屏幕上显示的内容。我没有注意到,如果我滚动屏幕上的项目,他们不会重新油漆。我还必须检查自己的内部选择标志。谢谢
cell?.backgroundColor = UIColor.redColor()