I saw this question here: UIImagePicker allowsEditing stuck in center
It seems someone had this problem before, but there's no clear resolution.
Reproduction steps:
I'm on iOS 7.0.3.
Here's my code:
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.delegate = self;
imagePicker.modalPresentationStyle = UIModalPresentationCurrentContext;
imagePicker.allowsEditing = YES;
[self presentViewController:imagePicker animated:YES completion:nil];
你只需要写下单行代码。
UIImage *image = [info valueForKey:UIImagePickerControllerEditedImage];
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.allowsEditing = YES; // YES
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
[self presentViewController:picker animated:YES completion:NULL];
try this i think you are missing the UIImagePickerControllerSourceTypeCamera on the sourceType. see if it works.
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.