UIScreenBrightnessDidChangeNotification不发送亮度为0.0的通知

时间:2015-02-02 18:58:30

标签: ios nsnotificationcenter brightness screen-brightness uiscreen

正常注册UIScreenBrightnessDidChangeNotification会在用户完成滑动控制中心的亮度滑块时发出通知。 当亮度设置为0.0时,似乎存在阻止发送通知的错误。基本上,产生通知的值范围是(0.0,1.0)

我在这里遗漏了什么吗?

测试非常简单:

NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
[center addObserverForName:UIScreenBrightnessDidChangeNotification
                    object:nil
                     queue:nil
                usingBlock:^(NSNotification *notification)
{
    NSLog(@"Brightness changed: %f", [[UIScreen mainScreen] brightness]);
}];

0 个答案:

没有答案