Does the SDK provide any way to change the brightness of the backlight, or turn it off temporarily?
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- how do you prevent page scroll in textarea on mobi
- Custom UITableview cell accessibility not working
相关文章
- Could I create “Call” button in HTML 5 IPhone appl
- Unable to process app at this time due to a genera
- How do you detect key up / key down events from a
- “Storyboard.storyboard” could not be opened
- Open iOS 11 Files app via URL Scheme or some other
- Can keyboard of type UIKeyboardTypeNamePhonePad be
- Can not export audiofiles via “open in:” from Voic
- XCode 4.5 giving me “SenTestingKit/SenTestKit.h” f
No. This is not available in the SDK. If it's something you think would be useful, I suggest you file an enhancement request.
In my SDK (5.0.1) it seems that "GraphicsServices.h" is no longer there, but you can declare it yourself like this:
Note that the linker will complain, unless you include the framework GraphicsServices.framework in your project.
About your question about turning the backlight off, I found out that you can do it by passing a very large negative number to GSEventSetBacklightLevel, like this:
In my tests this will completely black out the screen.
Remember that this might still cause burn-in in the LCD pixels if you display static graphics, even when the backlight is off. And that this call will cause rejection if submitteed to app store.
try this code. i hope it helps...
call the above method using
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
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
which requires this header to be imported
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.