解决UICollectionView的Cell复用引起的布局混乱问题

NSString *cellId = [NSString stringWithFormat:@"cellId%ld,%ld,%ld",(long)collectionView.tag,indexPath.section,indexPath.row];
[collectionView registerClass:[MTCameraStickerCell class] forCellWithReuseIdentifier:cellId];
MTCameraStickerCell *cell = (MTCameraStickerCell *)[collectionView dequeueReusableCellWithReuseIdentifier:cellId forIndexPath:indexPath];

给每个cell 标志唯一的id

你可能感兴趣的:(解决UICollectionView的Cell复用引起的布局混乱问题)