I have a horizontally scrollable UICollectionView, I am setting the horizontal direction using UICollectionViewFlowLayout.
When I delete one of the cell using -
[self.collectionView deleteItemsAtIndexPaths:selectedItemsIndexPaths];
I notice that on scrolling back to the first UICollectionViewCell(Which is not visible when the above cell is deleted) overlaps with the second UICollectionViewCell as shown below
Sometimes instead of overlapping it ends up like -
My cellForItemAtIndexPath looks like -
ABCollectionViewCell *cell = (ABCollectionViewCell *)[cv dequeueReusableCellWithReuseIdentifier:@"abCell" forIndexPath:indexPath];
cell.name.text = [self.categoryArray objectAtIndex:indexPath.row];
cell.contactButton.tag = indexPath.row;
cell.layer.cornerRadius = 5.0;
cell.layer.borderColor = [UIColor lightGrayColor].CGColor;
cell.layer.borderWidth = 1.0;
cell.clipsToBounds = YES;
return cell;
I have tried all the similar issues solution online but none of them seem to be working. Any help would be appreciated.
UICollectionViewFlowLayout -
UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout alloc] init];
[flowLayout setScrollDirection:UICollectionViewScrollDirectionHorizontal];
flowLayout.estimatedItemSize = CGSizeMake(102.0, 102.0);
flowLayout.minimumLineSpacing = 6.0f;
flowLayout.minimumInteritemSpacing = 2.0f;
[self.collectionView setCollectionViewLayout:flowLayout];

