开发者

Get Auto-Brightness level

开发者 https://www.devze.com 2023-04-05 11:06 出处:网络
I was wondering if there was a way to get the back-light or auto-brightness level of an iOS-device using the public frameworks.

I was wondering if there was a way to get the back-light or auto-brightness level of an iOS-device using the public frameworks.

Using UIScreen's brightness property simply gets the brightness level set by the user in System Preferences, which may be different than the auto-brightness level - in most cases, it is, which means that the aforementioned property does not auto-adjust if the auto-brightness switch (in System preferences) i开发者_JAVA百科s turned on.

Thanks!


Turns out you need to use the private API, or write your own classes o calculate the brightness from one of the cameras on the device.

0

精彩评论

暂无评论...
验证码 换一张
取 消