ios7 - 如何在 IOS 7 中通过相机捕获图像后跳过重拍/使用照片选项

标签 ios7 uiimagepickercontroller photo

在这里,我正在使用 IOS 7 开发一个应用程序,其中相机用于捕获图像。但在捕获图像后,它会显示重拍/使用照片选项。我希望在捕获图像后直接进入下一个屏幕而不显示默认重拍?使用照片选项。我用谷歌搜索了这个问题,但我没有得到正确的解决方案。请帮我解决这个问题。

提前致谢。

这是我在项目中使用的代码片段

enter image description here

-(void)StartCamera

{

if (![UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])

{  

  UIAlertView *myAlertView = [[UIAlertView alloc] initWithTitle:@"Error"           message:@"Device has no camera" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles: nil];

    [myAlertView show];
}
else
{ 
    picker = [[UIImagePickerController alloc] init];
    picker.delegate = self;
    picker.allowsEditing = NO;
    picker.sourceType = UIImagePickerControllerSourceTypeCamera;
    [self presentViewController:picker animated:YES completion:NULL];
}
}

最佳答案

现货UIImagePickerControllerSourceTypeCamera iOS 提供的这两个按钮都有。

实现您想要的一种方法是继续使用 UIImagePickerViewController并设置showsCameraControlsNO .然后,使用 cameraOverlayView 提供您自己的用户界面为您的自定义叠加 View 。

self.picker.showsCameraControls = NO;

self.overlay = [[OverlayViewController alloc] initWithNibName:@"Overlay" bundle:nil];
self.overlay.pickerReference = self.picker;

self.picker.cameraOverlayView = self.overlay.view;
self.picker.delegate = self.overlay;

另一种方法是使用 AVFoundation创建自己的相机 View 。

关于ios7 - 如何在 IOS 7 中通过相机捕获图像后跳过重拍/使用照片选项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23887109/

相关文章:

javascript - "alert()"和 "confirm()"不适用于 "apple-mobile-web-app-capable"

ios - 在启动时暂停 SKScene

javascript - 如何在浏览器中拍照并使用http协议(protocol)上传?

PHP 画廊,缩略图列表

ios - iOS 7 的 UISplitViewController "ViewIdentifier was not found in Storyboard"错误

ios - dismissModalViewControllerAnimated : does not dismiss the modal view

ios - 如何使用 [camera takePhoto] 并使用 UIImagePicker 进行编辑 - UIImagePickerController.allowsEditing = YES

iphone - UIimagepicker Controller 仅选择图像

Android - FileNotFoundException

ios7 - 使 AVCaptureSession 只扫描一次