Reputation: 5259
Here is my code:
-(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]];
}
and I have implemented the delegates
UINavigationControllerDelegate,UIImagePickerControllerDelegate
The image is taken, I can see the move and scale box, but when I move it the box returns to the initial position - likes it bounces back.
Why is that?
Upvotes: 10
Views: 351
Reputation: 9002
Looks like this is caused because you are requesting the UIImagePickerControllerOriginalImage
, according to the documentation this returns "the original, uncropped image selected by the user."
Try changing this to UIImagePickerControllerEditedImage
.
Edit: Actually after re-reading the question a couple of times if the problem is occurring in the picker itself this probably won't help.
Upvotes: 1