0

我已经在我的应用程序中实现了 ElCImagePicker 代码以选择多个图像。但是当我单击 select_images 按钮时,它会很好地显示图像并且也可以选择图像,但我的问题是它在图像列表中显示视频截屏。所以要做什么改变只显示图像而不是视频..

-(void)viewDidAppear:(BOOL)animated
{
    ELCImagePickerController *elcPicker = [[ELCImagePickerController alloc] initImagePicker];

    elcPicker.maximumImagesCount = 10; //Set the maximum number of images to select to 100
    elcPicker.returnsOriginalImage = YES; //Only return the fullScreenImage, not the fullResolutionImage
    elcPicker.returnsImage = YES; //Return UIimage if YES. If NO, only return asset location information
    elcPicker.onOrder = YES; //For multiple image selection, display and return order of selected images
    elcPicker.mediaTypes = @[(NSString *)kUTTypeImage, (NSString *)kUTTypeMovie]; //Supports image and movie types

    elcPicker.imagePickerDelegate = self;

    [self presentViewController:elcPicker animated:YES completion:nil];
}

- (void)displayPickerForGroup:(ALAssetsGroup *)group
{
     ELCAssetTablePicker *tablePicker = [[ELCAssetTablePicker alloc] initWithStyle:UITableViewStylePlain];
     tablePicker.singleSelection = YES;
     tablePicker.immediateReturn = YES;

     ELCImagePickerController *elcPicker = [[ELCImagePickerController alloc] initWithRootViewController:tablePicker];
     elcPicker.maximumImagesCount = 1;
     elcPicker.imagePickerDelegate = self;
     elcPicker.returnsOriginalImage = YES; //Only return the fullScreenImage, not the fullResolutionImage
     elcPicker.returnsImage = YES; //Return UIimage if YES. If NO, only return asset location information
     elcPicker.onOrder = NO; //For single image selection, do not display and return order of selected images
     tablePicker.parent = elcPicker;

// Move me
    tablePicker.assetGroup = group;
    [tablePicker.assetGroup setAssetsFilter:[ALAssetsFilter allAssets]];

    [self presentViewController:elcPicker animated:YES completion:nil];
}

编辑:-

我得到了上述问题的答案,但这些选定的图像显示在此代码的滚动视图中的 imageview 中,但任何人都知道将这些选定图像显示到集合视图的代码。

4

1 回答 1

2

我在您的代码中看到一行内容:

elcPicker.mediaTypes = @[(NSString *)kUTTypeImage, (NSString *)kUTTypeMovie]; //Supports image and movie types

将其更改为:

elcPicker.mediaTypes = @[(NSString *)kUTTypeImage]; //Supports image types

看看会发生什么。

于 2015-07-13T09:13:35.280 回答