【发布时间】:2014-07-15 14:05:37
【问题描述】:
我有两个数组:
- feedbackImages - UIImages 数组
- feedbackVideos - 一个字典数组,其中包含两个键,视频 url 和缩略图。
我遇到的问题是第二部分(反馈视频)的所有单元格都没有显示。我目前正在为每个单元格使用一个图像来尝试让它工作。
当记录数组的计数时,它们都显示它们中有项目。
这是我的收藏视图代码:
#pragma mark - Collection View
- (NSInteger)numberOfSectionsInCollectionView: (UICollectionView *)collectionView
{
return 2;
}
- (NSInteger)collectionView:(UICollectionView *)view numberOfItemsInSection:(NSInteger)section
{
if (section == 1)
{
return [self.feedbackImages count];
}
else if (section ==2 )
{
return [self.feedbackVideos count];
}
return 0;
}
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
ImageCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"Cell" forIndexPath:indexPath];
UIImage *image = [[UIImage alloc] init];
image = [UIImage imageNamed:@"86-camera.png"];
cell.ImageView.image = image;
return cell;
}
我错过了什么吗?
【问题讨论】:
标签: ios objective-c uicollectionview