рабочего автофокуса в камере xamarin ios?
NSError error;
cameraOptions = options;
IsPreviewing = false;
CaptureSession?.BeginConfiguration();
CaptureSession.RemoveInput(CaptureSession.Inputs[0]);
var cameraPosition = (cameraOptions == CameraType.Front) ? AVCaptureDevicePosition.Front : AVCaptureDevicePosition.Back;
var videoDevices = AVCaptureDevice.DevicesWithMediaType(AVMediaType.Video);
var device = videoDevices.FirstOrDefault(d => d.Position == cameraPosition);
if (device.IsFocusModeSupported(AVCaptureFocusMode.ContinuousAutoFocus))
{
device.LockForConfiguration(out error);
device.FocusMode = AVCaptureFocusMode.ContinuousAutoFocus;
device.UnlockForConfiguration();
}
var input = new AVCaptureDeviceInput(device, out error);
CaptureSession.AddInput(input);
CaptureSession.CommitConfiguration();
CaptureSession.StartRunning();
IsPreviewing = true;
тестирую на IPad (IOS 9.0.1)
Обсуждают сегодня