Unable to reset brightness when exiting iOS app

Why can't I set the screen brightness in applicationDidEnterBackground or applicationWillResignActive?

This is my code:

-(void)applicationDidEnterBackground:(UIApplication *)application { 
    [[UIScreen mainScreen] setBrightness:1.0];
}

Can't figure it out ...!? It works in applicationDidEnterForegroundetc. Only when I close the application using the home button.

Is there any other solution to this problem?

+3
source share
2 answers

August 2016 update:

The brightness changes made by the application remain valid until the device is locked, regardless of whether the application is closed. The brightness of the system (which the user can set in Settings or the Control Center) is restored the next time the display is turned on.

https://developer.apple.com/reference/uikit/uiscreen/1617830-brightness

2012:

. , :

https://devforums.apple.com/thread/139813?start=0&tstart=0

, . , , .

, 0 . - . , .

, ! Apple , .

+9

applicationDidEnterBackground.

, , UIView . UIView. .

, iOS5.

[[UIScreen mainScreen] setBrightness: 1.0];

iOS3.4.

0

All Articles