在没有UIImagePicker的情况下在iOS中拍照,无需预览 [英] Take a picture in iOS without UIImagePicker and without preview it

查看:139
本文介绍了在没有UIImagePicker的情况下在iOS中拍照,无需预览的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你知道在iOS中拍照的任何方式/方法并将其保存到相机仅使用简单的按钮压力滚动而不显示任何预览?

Do you know any way / method to take a photo in iOS and saving it to camera Roll only with a simple button pressure without showing any preview?

我已经知道如何显示相机视图,但它显示图像的预览,用户需要点击拍照按钮拍照。

I already know how to show the camera view but it show the preview of the image and the user need to click the take photo button to take the photo.

用几句话来说:用户点击按钮,拍摄照片,不进行预览,也不进行双重检查以拍摄/保存照片。

In few Words: the user click the button, the picture is taken, without previews nor double checks to take / save the photo.

我已经找到 takePicture 方法 UIIMagePickerController Class http://developer.apple.com/library/ios /documentation/uikit/reference/UIImagePickerController_Class/UIImagePickerController/UIImagePickerController.html#//apple _ref / occ / instm / UIImagePickerController / takePicture

I already found the takePicture method of UIIMagePickerController Class http://developer.apple.com/library/ios/documentation/uikit/reference/UIImagePickerController_Class/UIImagePickerController/UIImagePickerController.html#//apple_ref/occ/instm/UIImagePickerController/takePicture

推荐答案

设置 showsCameraControls -Property to NO

Set the showsCameraControls-Property to NO.

    poc = [[UIImagePickerController alloc] init];
    [poc setTitle:@"Take a photo."];
    [poc setDelegate:self];
    [poc setSourceType:UIImagePickerControllerSourceTypeCamera];
    poc.showsCameraControls = NO;

您还必须在 poc.view 。但这很简单,您可以通过这种方式添加自己的UI样式。

You also have to add your own Controls as a custom view on the top of poc.view. But that is very simple and you can add your own UI-style by that way.

您通常在 imagePickerController中收到图像数据:(UIImagePickerController *)选择器didFinishPickingMediaWithInfo:

要拍照,请致电

[poc takePicture];

来自您的自定义按钮。

希望,这适合你。

这篇关于在没有UIImagePicker的情况下在iOS中拍照,无需预览的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆