0
後,我有一個基本的UICollectionView,如果我滾動將「重繪」對細胞的頂部的標籤,IOS UICollectionView細胞不刷新滾動
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
UICollectionViewCell *cell=[collectionView dequeueReusableCellWithReuseIdentifier:@"cellIdentifier" forIndexPath:indexPath];
cell.backgroundColor=[UIColor greenColor];
UILabel *title = [[UILabel alloc]initWithFrame:CGRectMake(0, 10, cell.bounds.size.width, 40)];
[cell.contentView addSubview:title];
//NSString *titleLbl = [NSString stringWithFormat:@"i = %d", indexPath.row];
title.text = [self.arraya objectAtIndex:indexPath.row];
return cell;
}
如何解決它,所以它刷新滾動後的正確單元格? 乾杯
見http://stackoverflow.com/questions/16517844/uicollectionview-reload-data-issue,HTTP:// stackoverflow.com/questions/21753707/uilabel-overloading-in-uicollectionview,http://stackoverflow.com/questions/21798907/preventing-uicollectionview-from-redrawing等 – Anna