我不确定,但我认为通过简单地调用来实现是不可能的performBatchUpdates:
,我认为覆盖它是没有意义的。
但是这样做的简单技巧是使单元格透明,然后调用 UIViewanimateWithDuration:animations:
的collectionView:cellForItemAtIndexPath:
例如:
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"SMSourceEntityCell";
SMSourceEntityCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:CellIdentifier forIndexPath:indexPath];
cell.backgroundImageView.alpha = 0.1;
cell.entityImageView.alpha = 0.1;
cell.entityImageEffect.alpha = 0.1;
[UIView animateWithDuration:2.0 animations:^{
cell.backgroundImageView.alpha = 1;
cell.entityImageView.alpha = 1;
cell.entityImageEffect.alpha = 1;
}];
return cell;
}