如何在图像文件的集合视图中显示视频文件?

时间:2015-03-25 06:59:09

标签: ios objective-c xcode5 uicollectionview

我从图像中创建一个集合视图。现在我想从视频中制作该集合视图。但我无法解决问题。

- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
    UICollectionViewCell *cell=[collectionView dequeueReusableCellWithReuseIdentifier:@"cellIdentifier" forIndexPath:indexPath];

//It shows images in collection view
cell.backgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:[imageFileNames objectAtIndex:indexPath.row]]];

//It does not shows videos in collection view
cell.backgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:[videoFileNames objectAtIndex:indexPath.row]]];

}

0 个答案:

没有答案