我如何只加载一个没有动画的单元格。我尝试使用
horizontalItem.selectedType = horizontalItem.selectedType == .deselected ? .selected : .deselected
collectionView.reloadItems(at: [indexPath])
并更改背景和标题颜色,但通过动画更改样式。
您可以使用performWithoutAnimation
的UIView
方法>
UIView.performWithoutAnimation {
collectionView.reloadItems(at: [indexPath])
}