我在这里看到这个问题:UIImagePicker allowsEditing stuck in center
之前好像有人遇到过这个问题,但是没有明确的解决办法。
复制步骤:
- 设置 allowsEditing = YES
- 拍照
- 出现裁剪窗口,但每次我平移图像时,它都会快速回到中心。
我使用的是 iOS 7.0.3。
这是我的代码:
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];
关于ios - 带有 allowsEditing 的 UIImagePickerController 不允许平移裁剪,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20000273/