问题描述:最后一个cell上会叠加一个类似于支付宝的新字图标在cell的左上角。当点击其它cell时,这个新字图标会在其它cell上重叠显示。
第一种方法:设置cell的frame (如下红色代码),然后 [self.collectionView reloadData];
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *identify = @"cell";
CHCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:identify forIndexPath:indexPath];
[cell sizeToFit];
if (!cell)
{
cell = [[CHCollectionViewCell alloc] initWithFrame:CGRectMake(0,0, (UISCREENWIDTH)/CELLCOUNTEVERYLINE, (UISCREENWIDTH)/CELLCOUNTEVERYLINE)]
}
第二种方法:单独加在这个cell
NSIndexPath *indexPaths = [NSIndexPath indexPathForRow:8 inSection:0];
[UIView performWithoutAnimation:^{
[self.collectionView reloadItemsAtIndexPaths:@[indexPaths]];
}];