我想裁剪在应用中拍摄的照片然后保存。我正在使用GKImagePicker,所以我可以这样做,但如果我使用下面的代码,即使我在我的应用程序中按下拍照按钮,它会显示我选择要剪切的照片库。我不想这样做,只想裁剪我在应用程序中拍摄的照片。
- (IBAction)takePhoto:(UIButton *)sender {
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
self.imagePicker = [[GKImagePicker alloc] init];
self.imagePicker.cropSize = CGSizeMake(320, 320);
self.imagePicker.delegate = self;
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
[self presentModalViewController:self.imagePicker.imagePickerController animated:YES];
[self presentViewController:picker animated:YES completion:NULL];
}
答案 0 :(得分:0)
删除代码中的最后一行:
[self presentViewController:picker animated:YES completion:NULL];// remove
并尝试一下;)
您还可以查看this。