在ELCImagepicker中显示视频和图像

时间:2015-07-13 09:11:35

标签: ios objective-c iphone xcode elcimagepickercontroller

我已经将ElCImagePicker代码实现到我的应用程序中以选择多个图像。但是当我点击select_images按钮然后它显示图像非常好并且还可以选择图像但我的问题是它在图像列表上显示视频{{ 0}}。所以要做什么改变只显示图像而不是视频..

-(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];
}

修改: -

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

1 个答案:

答案 0 :(得分:2)

我在代码中看到一行说:

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

将其更改为:

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

看看会发生什么。