IPhone iOS 4.3 camera focus square - removeable programmatically?

蓝咒 提交于 2019-12-17 19:54:37

问题


Since my friend updated his iPhone iOS to 4.3 there's a small square which appears every time he takes a picture with the camera. We're developing an app that uses the camera and would like to remove this annoying square. I didn't find anything about it in Apple's UIImagePickerController documentation. The square didn't exist in former iOS versions.


回答1:


You may want to try to lock the focus to disable auto-focus. Here is a sample code:

    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];
        }
    }



回答2:


Setting the .showsCameraControls property of your picker controller to NO should remove the focus square (it did pre 4.3, I don't think anything has changed), but the downside is you'll need to provide your own controls (to take photos, etc). It's all or nothing I'm afraid!




回答3:


Create a custom overlay and default overlay will not display. You can make your overlay can be completely empty.



来源:https://stackoverflow.com/questions/5402461/iphone-ios-4-3-camera-focus-square-removeable-programmatically

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!