UICollectionview在滚动后加载图像

时间:2016-08-21 12:47:13

标签: ios objective-c uicollectionview horizontal-scrolling

我正在使用UICollectioView来显示图像列表。图像存储在项目内部。问题是滚动两到三次后会显示图像。我的问题与this相同。但它没有解决问题。

- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
static NSString *identifier = @"Cell";

UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:identifier forIndexPath:indexPath];

 UIImageView *recipeImageView = (UIImageView *)[cell viewWithTag:100];
recipeImageView.image = [UIImage imageNamed:[arr objectAtIndex:indexPath.row]];


return cell;
}

0 个答案:

没有答案