先生、私は初心者です。私はこれを理解することができません。 collectionViewをスクロールしている間、私は遅れに直面しています。私は細胞影を取り除き、遅れがなくなった。しかし、私は影を追加したい。私の携帯電話の商品コードは:スクロール中のCollectionViewの遅れ
- (UICollectionViewCell *)collectionView:(UICollectionView *)cv cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
NSString *cellIdentifier = @"cellCollection";
[self.MainCollectionView registerClass:[CVC_ImageWithLabel class] forCellWithReuseIdentifier:cellIdentifier];
CVC_ImageWithLabel *customCell = (CVC_ImageWithLabel *)[self.MainCollectionView dequeueReusableCellWithReuseIdentifier:cellIdentifier forIndexPath:indexPath];
//cell text
customCell.NameLabel.text = [data_Array objectAtIndex:indexPath.row];
//cell image
customCell.CellImage.image=[UIImage imageNamed:[image_Array objectAtIndex:indexPath.row]];
customCell.CellImage.contentMode = UIViewContentModeScaleAspectFit;
return customCell;
}
私を助けてくれますか? 以下のコードを追加しようとしましたが、失敗しました。
customCell.layer.shouldRasterize = YES;
customCell.layer.rasterizationScale = [UIScreen mainScreen].scale;
cellForItemにコードを追加 – karthikeyan
フルコードが追加されました。 –
このビューを追加します。[セル。 – karthikeyan