iOS 5中获取屏幕亮度值
我已经开始在 UIScreen 中使用新的 iOS 5 亮度设置器。是否有一个 getter 属性可以用来了解启动时显示亮度的设置?
非常感谢。
I've started to use the new iOS 5 brightness setter in UIScreen. Is there a getter property I can use to know what the display brightness is set to on launch?
Thanks very much.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
相同的财产。这些是我在更改之前用来存储当前亮度的方法,然后将亮度重置为之前的值:
更新: 值得注意的是,
UIScreen
报告的亮度非常有用仅是用户在“设置”中设置的亮度,不报告自动亮度调节值。如果启用自动亮度,我知道无法获得调整后的值。举个例子,如果用户在“设置”中将亮度滑块设置为 100%,但当前处于非常黑暗的房间中,则
UIScreen
将报告亮度为 1.0,但真实值可能更接近0.5。The same property. These are the methods I use to store the current brightness before changing it, then reset brightness to the previous value later:
Update: It's useful to note that the brightness reported by
UIScreen
is only the brightness the user has set in Settings, and does not report the auto brightness adjusted value. If auto brightness is enabled, I am aware of no way to get the adjusted value.As an example, if the user has the brightness slider at 100% in Settings but they are currently in a very dark room, then
UIScreen
will report a brightness of 1.0, but the true value might be closer to 0.5.