Change Backlight Brightness on iPhone Programmatically

后端 未结 5 1098
無奈伤痛
無奈伤痛 2020-12-01 23:15

Does the SDK provide any way to change the brightness of the backlight, or turn it off temporarily?

5条回答
  •  情深已故
    2020-12-01 23:51

    -(void)changeLight{
    
        GSEventSetBacklightLevel(float number);//number between 0.0 - 1.0
    }
    

    call the above method using

    [self performSelector:@selector(changeLight) withObject:nil afterDelay:0.0];
    

    you can add the private framework by just drag and drop to your xcode project from /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/System/Library/PrivateFrameworks/GraphicsServices.framework.

    Also add #import "GraphicsServices.h" header in your .h file..remember: since you are using private framework you application will reject in app store push

提交回复
热议问题