Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
526 views
in Technique[技术] by (71.8m points)

Change Backlight Brightness on iPhone Programmatically

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...