如果有人从他的图书馆中选择了一张照片,我想展示预览。
我的代码:
UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];
imagePickerController.delegate = self;
imagePickerController.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;
imagePickerController.allowsImageEditing = NO;
[[self parentViewController] presentModalViewController:imagePickerController animated:YES];
[imagePickerController release];
如果我设置allowsImageEditing = YES,它会显示预览(就像我想要的那样),但我可以编辑照片(缩小/剪切)。我只是希望用户可以选择取消或确认选择照片,例如拍摄新照片时的预览(UIImagePickerControllerSourceTypeCamera)。
我想在右侧预览:
答案 0 :(得分:0)
您可以在UIImagePickerController的委托类的didFinishPickingMediaWithInfo方法中创建和显示自定义预览。从
获取图片originalImage = (UIImage *) [info objectForKey: UIImagePickerControllerOriginalImage];
在ImageView中显示它。
还需要设置UIImagePickerController.showsCameraControls = NO。