我有一个问题,我创建了UICollectionView与自定义单元格来显示项目。但刷新后的UICollectionView可重复使用的单元填充错误索引UICollectionView Static CustomCell reuse
刷新前的UICollectionView。
刷新后UICollectionView。可重复使用的集合视图细胞的
代码示例。
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
GalleryCollectionCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:reuseIdentifier forIndexPath:indexPath];
if (indexPath.item != 0)
{
[cell setCollectionItem:[collectionData_ objectAtIndex:indexPath.row - 1]];
}
return cell;
}