有没有办法在 iOS 设备上调整手电筒/闪光灯亮度级别? [英] Is there a way to adjust the torch/flash brightness level on an iOS device?

查看:11
本文介绍了有没有办法在 iOS 设备上调整手电筒/闪光灯亮度级别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经阅读了很多关于调整屏幕亮度的主题,但是否可以对闪光灯做同样的事情,或者它是二进制开/关?

I've read plenty of topics on adjusting the screen brightness but is it possible to do the same with the flash or is it a binary on/off?

推荐答案

在IOS 6+,你可以.

In IOS 6+, you can.

[myAVCaptureDevice setTorchModeOnWithLevel:0.5 error:NULL]; <== range is (0,1.0] (don't send 0)

您可以像这样枚举 av 捕获设备:

You can enumerate the av capture devices like so:

NSArray * devices = [AVCaptureDevice devices];

并确定哪些有手电筒(即不是麦克风:):

and determine which have torches (i.e. not microphones :):

myAVCaptureDevice.hasTorch

http://developer.apple.com/library/ios/#documentation/AVFoundation/Reference/AVCaptureDevice_Class/Reference/Reference.html

这篇关于有没有办法在 iOS 设备上调整手电筒/闪光灯亮度级别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆