UICollectionView设置好代理,断点发现
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section 调用了。
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath 没有调用。
解决方法:控制器里 self.automaticallyAdjustsScrollViewInsets = NO;
本文解决了UICollectionView在设置代理后cellForItemAtIndexPath未被调用的问题。通过将控制器中的automaticallyAdjustsScrollViewInsets属性设置为NO,成功触发了cell的加载。
1470

被折叠的 条评论
为什么被折叠?



