ReloadItems 似乎不允许动画。
我尝试使用 collectionView:( willDisplay) 但 reloadItems() 实际上超过了动画(即切断它并重新加载单元格)
我尝试了 performBatchUpdates() 但在此块中出现 outOfRange 错误:
collectionView.performBatchUpdates({
// reload one or more items
collectionView.reloadItems(at: [tappedArray[0], tappedArray[1]])
}) { (_) in
// do animations here
if let cell1 = collectionView.cellForItem(at: self.tappedArray[1]) {
self.animateCell(cell1)
}
}
如果重新加载 collectionView 中的单个项目,如何将动画添加到该项目的重新显示?