iOS --- UICollectionView中使用reloadItemsAtIndexPaths进行局部cell更新
来源:互联网 发布:ubuntu控制台关机 编辑:程序博客网 时间:2024/06/13 06:30
UICollectionView与UITableView类似,都可以使用reloadData来进行cell内容的更新。然而如果想要进行局部cell更新呢?
UICollectionView
可以采用reloadItemsAtIndexPaths方法。
[self.collectionView reloadItemsAtIndexPaths:@[indexPath]];
传入参数就是要刷新的cell所在的indexPath组成的数组。
但,reloadItemsAtIndexPath默认会有一个动画的过程,cell内容更新的瞬间会出现原内容与新内容重叠的情况。那么使用如下方式取消该动画即可:
[UIView performWithoutAnimation:^{ [self.collectionView reloadItemsAtIndexPaths:@[indexPath]];}];
UITableView
UITableView的reloadSections方法也有同样的情况:
[self.tableView reloadSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:UITableViewRowAnimationNone];
而使用reloadData进行全部cell的更新,则没有这个默认的动画过程。
0 0
- iOS --- UICollectionView中使用reloadItemsAtIndexPaths进行局部cell更新
- iOS UICollectionView 和 UITableView cell更新 详解
- 在iOS中对cell进行局部截图
- iOS UICollectionView reloadData后找到某个cell 更新某个cell数据
- IOS中UICollectionView的使用
- ios UICollectionView的cell重叠
- swift中UICollectionView的使用(headerview/footerview/cell/model)
- UICollectionView使用Xib自定义cell
- iOS中UICollectionView实现单个cell滚动翻页并放大cell
- iOS中UICollectionView(集合视图)的使用
- iOS 关于UICollectionView的cell重用问题
- iOS开发 怎么删除UICollectionView的cell
- iOS UI 18 uicollectionview和自定义cell
- iOS开发:xib之UICollectionView自定义cell
- IOS UItableview UIcollectionview cell高度自适应
- [iOS]UICollectionView设置cell之间的间距
- UICollectionView中cell的border问题
- iOS中 UICollectionView UI_19
- xdebug在linux下的安装教程
- ArrayList LinkedList Vector 区别
- Tmux使用初体验
- android 用Parcelable在组件中传递List集
- Microservice架构模式简介
- iOS --- UICollectionView中使用reloadItemsAtIndexPaths进行局部cell更新
- Android--记录和恢复listView滚动位置的3种方法 (20
- 如何在esxi 6上面套嵌运行虚拟机(kvm、xen、esxi6、vmware workstation、Qemu)
- 短信JAVA开发接口
- 笔试答题的时候,用什么笔最好
- nyoj745蚂蚁的难题(二)【dp】
- UNIX环境高级编程———第三章习题
- NSNotificationCenter(通知中心)
- 二叉树的数量