大佬教程收集整理的这篇文章主要介绍了ios – UICollectionViewCell没有出现在UICollectionView中,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
CGRect collectionViewRect = CGRectMake(384,60,728,924); UICollectionViewFlowLayout *flow = [[UICollectionViewFlowLayout alloc] init]; imageCollectionView = [[UICollectionView alloc] initWithFrame:collectionViewRect collectionViewLayout:flow]; [imageCollectionView registerClass:[imageCell class] forCellWithReusEIDentifier:@"Cell"]; imageCollectionView.delegate = self; imageCollectionView.datasource = self;
然后我在viewDidAppear(用于UI的原因)中调用getPhotos方法,从服务中获取照片,然后调用[imagCcollectionView reloadData];里面的getPhotos.
然后在cellForItemATindexPath中,我执行以下操作:
imageCell *cell = [collectionView dequeueReusableCellWithReusEIDentifier:@"Cell" forIndexPath:indexPath]; GRKAlbum *album = [albums objectATindex:indexPath.item]; cell.titleLabel.text = album.name; return cell;
我知道这里没有做错什么,因为这个方法是被调用的,单元格不是零,也不是专辑.
所以,当我运行所有这些代码,UICollectionView出现,但没有任何内容.我可以看到的是collectionView的背景颜色.任何帮助都将不胜感激.
以上是大佬教程为你收集整理的ios – UICollectionViewCell没有出现在UICollectionView中全部内容,希望文章能够帮你解决ios – UICollectionViewCell没有出现在UICollectionView中所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。