ios - UICollectionView 在水平滚动时在下一个单元格中显示上一个单元格内容

标签 ios swift uicollectionview scrollview

我正在使用UICollectionView来显示图像数组水平并在帮助下放大/缩小单元格中的图像使用约束滚动 View 。但是当我水平滚动时,它会显示当前单元格中先前的单元格内容。我无法确定问题所在。 enter image description here

enter image description here

CollectionView datasources

enter image description here

CollectionCell Class enter image description here

最佳答案

当您在 cellForItem 中重用 Cell 时尝试此操作

cell.imageView.Image = nil

关于ios - UICollectionView 在水平滚动时在下一个单元格中显示上一个单元格内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43867188/

相关文章:

ios - 动态设置 UICollectionView 的 ContentSize

ios - UITableView 中的 UITextField 没有成为第一响应者

ios - 使被调用的 VC 可以访问调用 ViewController

ios - 禁用 segue 动画

ios - 将通过应用程序相机拍摄的照片与元数据一起保存到设备的相机胶卷

ios - Swift Collectionview didSelectItemAtIndexPath 不起作用

android - 如何检查 FirebaseAnimatedList 是否在 flutter 中返回数据

ios - 如何在 ios 中使用陀螺仪应用 3D 移动背景效果

uiview - 布局 subview 无法正常工作

ios - 当动画为假时,如何检测 UIScrollView 已完成滚动?