OGeek|极客世界-中国程序员成长平台

标题: ios - 如何在ios中选择多选图像 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-13 06:21
标题: ios - 如何在ios中选择多选图像

我正在为 iPhone 制作一个应用程序,并希望让用户能够从他们的照片库中多选图像。我已经有一个工作代码供用户一次选择四个图像。但我不能一次选择 2 或 3 个图像。我想一次选择 2 或 3 个图像。我正在尝试以下代码。请帮助我任何人。

- (id)initImagePicker
{    
    ELCAlbumPickerController *albumPicker = [[ELCAlbumPickerController alloc] initWithStyle:UITableViewStylePlain];    
    self = [super initWithRootViewController:albumPicker]; 
    if (self) 
    {          
        self.maximumImagesCount = 4; 
        [albumPicker setParent:self];
    }     
    else if (self)   
    {          
        self.minimumImageCount=1;        
        [albumPicker setParent:self];  
    }      
    return self;
}

- (id)initWithRootViewControllerUIViewController *)rootViewController
{  
    self = [super initWithRootViewController:rootViewController]; 
    if (self) 
        self.maximumImagesCount = 4;        
    else if (self)
        self.minimumImageCount=1;   
    return self;
}

-(void)choosePhotoFromExistingImages
{
    ELCImagePickerController *elcPicker = [[ELCImagePickerController alloc] initImagePicker];  
    elcPicker.maximumImagesCount = 4;
    elcPicker.returnsOriginalImage = NO; //Only return the fullScreenImage, not the fullResolutionImage
    elcPicker.imagePickerDelegate = self;
    [self presentViewController:elcPicker animated:YES completion:nil];
}



Best Answer-推荐答案


你应该试试MWPhotoBrowser Control by Michael Waterfall
他提供了单张和多张照片选择


适用于 iOS 5.1.1+。
所有字符串都是可本地化的,因此可以在支持多种语言的应用中使用。

关于ios - 如何在ios中选择多选图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21670656/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://sqlite.in/) Powered by Discuz! X3.4