0

How to stop the auto focusing in UIimagepickercontroller camera in iPhone sdk?

4

2 回答 2

0

设置showsCameraControlsNO喜欢下面..

picker.showsCameraControls = NO;

另请参阅此链接iphone-ios-4-3-camera-focus-square-removeable-programatically 的另一个答案

于 2013-07-31T11:12:42.640 回答
-2

您可能想尝试锁定焦点以禁用自动对焦。这是一个示例代码:

 NSArray *devices = [AVCaptureDevice devices];
    NSError *error;
    for (AVCaptureDevice *device in devices) {
        if (([device hasMediaType:AVMediaTypeVideo]) && 
            ([device position] == AVCaptureDevicePositionBack) ) {
            [device lockForConfiguration:&error];
             if ([device isFocusModeSupported:AVCaptureFocusModeLocked]) {
             device.focusMode = AVCaptureFocusModeLocked;
             NSLog(@"Focus locked");
             }

            [device unlockForConfiguration];
        }
    }

你也可以尝试将.showsCameraControls你的选择器控制器的属性设置为 NO 应该删除焦点方块(它在 4.3 之前做了,我认为没有任何改变),但缺点是你需要提供自己的控件(采取照片等)。

于 2013-07-31T11:11:52.090 回答