项目中有一个歌词随播放滚动的效果,为了适配别的需求选择了collection完成。
但在刷新对应item时发现了一个问题:collectionview不像tableview一样在刷新某一行时可以选择刷新动画,他的动画是默认从底部上升的。
查了一下,这样就可以关闭掉这个动画效果。
[UIView performWithoutAnimation:^{
[self.collection reloadItemsAtIndexPaths:@[[NSIndexPath indexPathForItem:self.currentIndex inSection:0],[NSIndexPath indexPathForItem:last inSection:0]]];
}];