重新加载没有动画的收藏视图Swift

问题描述 投票:1回答:1

我如何只加载一个没有动画的单元格。我尝试使用

horizontalItem.selectedType = horizontalItem.selectedType == .deselected ? .selected : .deselected
collectionView.reloadItems(at: [indexPath])

并更改背景和标题颜色,但通过动画更改样式。

swift uicollectionview uicollectionviewcell
1个回答
1
投票

您可以使用performWithoutAnimationUIView方法>

 UIView.performWithoutAnimation {
    collectionView.reloadItems(at: [indexPath])
 }
© www.soinside.com 2019 - 2024. All rights reserved.