IPhone iOS 4.3 camera focus square - removeable pr

2019-01-19 08:51发布

问题:

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.