我正在制作一个实现从相机拍照并从库中选择照片.
使用ELCImagePickerController从库中拍摄照片并在scrollview中设置图像.
我想要做的是从相机拍摄几张图像并在同一滚动视图上设置它.
目前我的实施是:
- (IBAction)takePhoto:(UIButton *)sender { UIImagePickerController *cameraPicker = [[UIImagePickerController alloc] init]; cameraPicker.delegate = self; cameraPicker.allowsEditing = YES; cameraPicker.sourceType = UIImagePickerControllerSourceTypeCamera; [self presentViewController:cameraPicker animated:YES completion:NULL]; } - (void)imagePickerController:(UIImagePickerController *)photoPicker didFinishPickingMediaWithInfo:(NSDictionary *)info { [photoPicker dismissViewControllerAnimated:YES completion:NULL]; UIImage *image=[info objectForKey:UIImagePickerControllerEditedImage]; UIImageView *imageview = [[UIImageView alloc] initWithImage:image]; [imageview setContentMode:UIViewContentModeScaleAspectFit]; [self.scrollView addSubview:imageview]; [self dismissModalViewControllerAnimated:YES]; }
有了这个,我每次只能拍一张照片,当我再次设置它时,它会替换另一张照片.我该怎么办?以及我如何做到这一点?