【发布时间】:2015-07-09 06:12:26
【问题描述】:
我有一个滚动图像的寻呼UICollectionView。每个图像填满屏幕。对于普通照片,我的collectionView 可以流畅地滚动,但是对于全景照片,当我滚动图像时它开始滞后。
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
imageCell *cell = (imageCell *)[collectionView dequeueReusableCellWithReuseIdentifier:@"cell" forIndexPath:indexPath];
cell.tag = indexPath.row;
PFObject *temp = [_dataArray objectAtIndex:indexPath.row];
PFUser *user = [temp objectForKey:@"user"];
PFFile *file = [temp objectForKey:@"image"];
[file getDataInBackgroundWithBlock:^(NSData *data, NSError *error){
if (!error) {
cell.selectedImageView.image = [UIImage imageWithData:data];
self.navigationItem.title = [user objectForKey:@"Name"];
}
}];
return cell;
}
如您所见,我在后台加载图像。
我有可能需要在willDisplayCell 中做点什么吗?。谢谢
【问题讨论】:
标签: ios uicollectionview lag collectionview