去掉UICollectionView 在 reloadItems时默认附加的隐式fade动画。
来源:互联网 发布:梦想海贼王超进化数据 编辑:程序博客网 时间:2024/05/16 15:04
//方法一[UIView performWithoutAnimation:^{ [collectionView reloadItemsAtIndexPaths:@[[NSIndexPath indexPathForItem:index inSection:0]]];}];
//方法二[UIView animateWithDuration:0 animations:^{ [collectionView performBatchUpdates:^{ [collectionView reloadItemsAtIndexPaths:@[[NSIndexPath indexPathForItem:index inSection:0]]]; } completion:nil];}];
如果你的APP只支持iOS7+ 推荐使用第一种方式performWithoutAnimation
上述情况多用于自定义控件使用了layer.mask的情况 如果有这种情况 上面提到的方法是无法取消CALayer的动画的 但是解决办法也很简单
- (void)layoutSubviews{ [super layoutSubviews]; [CATransaction begin]; [CATransaction setDisableActions:YES]; self.frameLayer.frame = self.frameView.bounds; [CATransaction commit];}
0 0
- 去掉UICollectionView 在 reloadItems时默认附加的隐式fade动画。
- 取消UICollectionView 的reloadItemsAtIndexPath默认动画
- 取消UICollectionView的隐式动画
- 取消UICollectionView的隐式动画
- Activity 去掉默认的动画效果
- 去掉activity默认动画效果的方法
- Activity去掉默认的动画效果方法:
- 去掉RecyclerView的默认item动画
- UICollectionView的Cell加载动画
- 解决UICollectionView ReloadData闪一下(隐式动画)
- 解决UICollectionView ReloadData闪一下(隐式动画)
- 解决UICollectionView ReloadData闪一下(隐式动画)
- Fade 的实现
- Default clip could not be found in attached animations list.无法在附加动画列表中找到默认剪辑。
- fade
- fade
- 去掉activity切换时的动画效果
- 去掉UIButton状态改变时的动画
- python ConfigParser
- Caffe学习系列:用训练好的caffemodel来进行分类
- Android官方开发文档Training系列课程中文版:管理系统UI之变暗系统条
- 多校&&HDU.5733 tetrahedron
- 简单文件搜索器的实现
- 去掉UICollectionView 在 reloadItems时默认附加的隐式fade动画。
- AngularJS学习笔记一
- POJ 1321 棋盘问题
- jQuery下拉框使用(一)
- 系统与规划设计图
- hadoop datanode 节点超时时间设置
- java环境变量设置详解
- Java循环跳转语句之 break
- android 悬浮图片滑动