这是我的代码:
-(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
拍摄的图像,我可以看到移动和缩放框,但是当我移动它时,框会返回到初始位置 - 就像它反弹一样。
为什么?
答案 0 :(得分:1)
看起来这是因为您要求UIImagePickerControllerOriginalImage
而导致的,根据此文档返回“用户选择的原始未剪切图像。”
尝试将其更改为UIImagePickerControllerEditedImage
。
编辑:实际上,在重新阅读问题几次后,如果选择器本身出现问题,这可能无济于事。