这是我的代码:
-(void) takePhoto { UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init]; imagePickerController.sourceType = UIImagePickerControllerSourceTypeCamera; //imagePickerController.editing = YES; imagePickerController.allowsEditing=YES; imagePickerController.delegate = self; [self presentViewController:imagePickerController animated:YES completion:NULL]; } #pragma mark - Image picker delegate methods -(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { [picker dismissViewControllerAnimated:NO completion:nil]; [self.Picture setImage:[info objectForKey:UIImagePickerControllerOriginalImage]]; }
我已经执行了代表们
UINavigationControllerDelegate,UIImagePickerControllerDelegate
图像被拍摄,我可以看到移动和缩放框,但是当我移动它时,框返回到初始位置 – 喜欢它反弹.
这是为什么?
解决方法
看起来这是因为您要求UIImagePickerControllerOriginalImage,根据文档返回“由用户选择的原始的未裁剪图像”.
尝试将其更改为UIImagePickerControllerEditedImage.
编辑:实际上,在重新阅读问题几次后,如果问题出现在选择器本身,这可能不会有帮助.