我当前的代码是:
- (IBAction)cameraButtonAction:(id)sender {
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.allowsEditing = NO;
picker.sourceType = (sender == cameraButton) ? UIImagePickerControllerSourceTypeCamera : UIImagePickerControllerSourceTypeSavedPhotosAlbum;
[self presentModalViewController:picker animated:YES];
}
这是调出默认相机,但是当我选择use
它时不会保存图片。我努力了 :
-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)editingInfo {
UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil);
[self dismissModalViewControllerAnimated:YES];
}
我看过的每个教程,他们都使用 a 制作了一个自定义相机应用程序,UIImageView
但这不是我想要做的,我不想在应用程序中显示图像并希望保留默认的相机功能。