0

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]);
}];
4

0 回答 0