IOS5 setBrightness didn't work with applicationWillResignActive

前端 未结 4 2125
陌清茗
陌清茗 2021-01-04 17:02

I use [[UIScreen mainScreen]setBrightness: ] (in sdk 5.0) to change the system background light in my app.

The following steps work with my app

4条回答
  •  春和景丽
    2021-01-04 17:43

    Try this...

    - (void)applicationWillResignActive:(UIApplication *)application
    {        
        CGFloat brightness = [[NSUserDefaults standardUserDefaults] floatForKey:@"sysBright"];
        [[UIScreen mainScreen] setBrightness:brightness];        
    }
    

提交回复
热议问题