Change Backlight Brightness on iPhone Programmatically

12,871

Solution 1

No. This is not available in the SDK. If it's something you think would be useful, I suggest you file an enhancement request.

Solution 2

I'm trying to do the same thing. As it happens there are a number posts out there in the internets with "solutions" for this.

The most detailed is here This one is more succinct

The problem is that I've tried these and they all rely on calling this function

GSEventSetBacklightLevel();

which requires this header to be imported

#import <GraphicsServices/GraphicsServices.h>

And that import fails in the SDK reporting that the header file cannot be found.

I've searched for some solution but haven't found it. There is some talk about "building the toolchain" (for the best description I've found see here) but that seems to involve bypassing the SDK altogether. Pretty drastic.

Summary: It's possible, but not with the standard iPhone SDK. I imagine an update to the SDK will come soon that should allow for it.

Let me know if you find any other solution.

Share:
12,871
Greg
Author by

Greg

I'm an avid programmer, web developer and electronics enthusiast. Here's my gift to Python hackers. And you can see everything I'm up to here.

Updated on June 14, 2022

Comments

  • Greg
    Greg about 2 years

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