- UITableView,UICollectionView判断re
- `UICollectionView` 在 iOS12 的BUG,
- iOS UICollectionView ReloadData的
- iOS【UICollectionView:reloadData与
- UICollectionView系统BUG记录 -— reloa
- iOS中UICollectionView调用reloadData
- UICollectionView中的Delete,insert,
- UITableView/UICollectionView调用re
- collectionView reloadData() 闪烁问题
- UICollectionView在reloadData时的一个坑
写了个类似记事本的功能,本来自测没问题的,可是到测试那用se测了下,出现了个奇怪的bug

当点击加号cell调到其他控制器添加一个新cell回到界面后变成了这个样子

而重新push到这个界面加号按钮才出现

刚开始也是一头雾水,在6plus,7上测试都没问题,偏偏就在se上有问题。。
打断点追踪,发现DataSource的array数据正常,而是cellForRow的方法执行次数却没有增加,比如明明在numberOfItemsInSection:
里return的是3,cellForItemAtIndexPath:
却只执行两遍。。····
断定是刷新的问题,把reloadData
改为了reloadSections:
额,好了。
猜想:为了节省性能,reloaddata只刷新初次显示的cell即visiblecell,而精确的reload item§ion 会有效刷新指定的内容
有时间会再深入研究的,也请大牛指教
网友评论