如何在使用ipod扫描时关闭闪光灯

时间:2016-05-10 06:10:26

标签: ios camera ipod zbar flashlight

我正在使用iPod来扫描门票,但每当我扫描门票时,闪光灯就会闪烁。如果我关闭相机中的闪光灯,它工作正常(不闪烁)。除了手动关闭相机的闪光灯之外还有其他方法吗?我正在使用Zbar库。我正在使用xamarin开发应用程序。

1 个答案:

答案 0 :(得分:0)

你可以做点什么,

 AVCaptureDevice *mDevice = mReader.readerView.device;
 [mDevice setTorchModeOnWithLevel:0.5 error:nil];  // you can use different torchmode!

 [myDevice setTorchMode:AVCaptureTorchModeOff]; // off torchmode

Dopn忘记导入AVFoundation

您可以参考this answewrthis answer了解详情。

希望这会有所帮助:)