简体   繁体   English

从 ios 获取 UnitIlluminance 的浮点数

[英]Get float of UnitIlluminance from ios

I want the luminance value of iPhone.我想要 iPhone 的亮度值。 In Android we can get it using Type_Light as given here: https://developer.android.com/guide/topics/sensors/sensors_environment在 Android 中,我们可以使用 Type_Light 获取它,如下所示: https : //developer.android.com/guide/topics/sensors/sensors_environment

I want the same for iOS.我想要同样的 iOS。 I want the value like 80.0 or 454.0 whatever the luminance is.无论亮度如何,我都想要 80.0 或 454.0 之类的值。 Is there any way I can get that?有什么办法可以得到吗?

On Android you can access the data from the light sensor.在 Android 上,您可以访问来自光传感器的数据。 Unfortunately on iOS there is no access to the light sensor.不幸的是,在 iOS 上无法访问光传感器。 An Apple developers relations developer responded to a similar question here:一位 Apple 开发者关系开发者在这里回答了一个类似的问题:

https://developer.apple.com/forums/thread/81806 https://developer.apple.com/forums/thread/81806

You could try using the camera, and getting the light intensity from there, but it will not be nearly or close to as accurate as the data from the light sensor.您可以尝试使用相机,并从那里获取光强度,但它不会像来自光传感器的数据那样准确或接近准确。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM