简体   繁体   中英

UIImagePickerController: How to allow editing but hide crop option

I want to pick an image from the gallery and show the preview for a user asking him/her to cancel/chose the image.

I can achieve this using the allowsEditing option but I want to hide the square crop that is displayed to the user, instead I just want to show the selected image in a separate view and give him an option to cancel or chose the selected image.

在此处输入图像描述

You cannot disable the 'crop' option if you are allowing the editing for the media but one thing that you do is to get the original image even if the user crops a selected image. See below Apple mentioned in the documentation.

https://developer.apple.com/documentation/uikit/uiimagepickercontroller/infokey

Use the infoKey and get the originalImage instead of the cropped.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM