我们必须让用户打开相册,选择图像并进行编辑。 所以使用选择器,我可以看到所有用户专辑,而不是进入我可以看到图像的专辑,而不是在点击图像时,我得到了代表。
为什么我在选择图片时看不到复选标记?我不清楚你真的选择它。你还可以选择多个,还是仍然禁用?
我无法编辑选定的图片,在我选择图片后,我接到了代表的电话,但我没有在任何地方设置编辑按钮。
UIImagePickerController *pickerLibrary = [[UIImagePickerController alloc] init]; pickerLibrary.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; pickerLibrary.delegate = self; pickerLibrary.editing=YES; [self presentViewController:pickerLibrary animated:YES completion:nil]; -(void)imagePickerController: (UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { NSString *mediaType = info[UIImagePickerControllerMediaType]; if ([mediaType isEqualToString:(NSString *)kUTTypeImage]) { UIImage *image = info[UIImagePickerControllerOriginalImage]; UIImage *imageE = info[UIImagePickerControllerEditedImage]; NSLog(@"%@",image); NSLog(@"%@",imageE); } else if ([mediaType isEqualToString:(NSString *)kUTTypeMovie]) { // Media is a video } // Code here to work with media [self dismissViewControllerAnimated:YES completion:nil]; }
答案 0 :(得分:0)
好的,回答是:
pickerLibrary.allowsEditing=YES;
而不是isEditing