UICollectionView不调用collectionView: cellForItemAtIndexPath:

UICollectionView设置好代理,断点发现

- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section 调用了。

- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath 有调用。

解决方法:控制器里  self.automaticallyAdjustsScrollViewInsets = NO;

猜你喜欢

转载自blog.csdn.net/wenzfcsdn/article/details/53943790