Webサービスからのデータが大量で、プロジェクトにコレクションビューがあります。コレクションビューを垂直方向にスクロールするとスムーズにスクロールしません。UICollectionViewがスムーズにスクロールしない
SDWebImage
を使用して、画像を非同期に読み込みました。ここで
はcellForItemAtIndexPath
のコードです:
-(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
CategoryListCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"CategoryListCell" forIndexPath:indexPath];
cell.movName.text = [nameArray objectAtIndex:indexPath.item];
num = [[numArray objectAtIndex:indexPath.item]integerValue];
cell.itemNo.text = [NSString stringWithFormat:@"%ld", (long)num];
[cell.movImage sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@",[imageArray objectAtIndex:indexPath.item]]] placeholderImage:[UIImage imageNamed:@"Main_Logo.png"]];
[cell.movImage setShowActivityIndicatorView:YES];
[cell.movImage setIndicatorStyle:UIActivityIndicatorViewStyleWhite];
return cell;
}
私はシミュレータ上でプロジェクトを実行すると、それがスムーズにスクロールするが、物理デバイス上でそれを実行したときに、それがスムーズにスクロールしません。これをどうすれば解決できますか?
は、私はあなたが時間プロファイラ計測器 – Paulw11
私は、あなたがcellForItemAtメソッド内のループのために必要ないけないと思いますが使用することをお勧めだけで使用NUM = [[numArray objectAtIndex:indexPath.item]するIntegerValue]。 cell.itemNo.text = [NSString stringWithFormat:@ "%ld"、(long)num]; forループは一切ありません – 3stud1ant3
私はすでにそれを使用しましたが、解決策Paulは見つかりませんでした。 – MUNNA