Changing Backlight Level, iPhone

后端 未结 2 482
甜味超标
甜味超标 2021-02-11 10:25

I searched around for a way to set the backlight level within an app on the iPhone. I found a solution here:

http://www.iphonedevsdk.com/forum/29097-post3.html

T

相关标签:
2条回答
  • 2021-02-11 10:58

    The reason you are getting a warning is because GSEventSetBacklightLevel() is a private API not declared in any of of the SDK headers. If you are planning to submit this to the app store your app will get rejected if you call it. If this is for a jailbroken device, you can just declare the function yourself.

    void GSEventSetBacklightLevel(float level);
    

    The reason you are getting the error is because you are trying to assign a float (which is a scalar) to an NSNumber *. You probably want to change previousBacklightLevel to be a float.

    0 讨论(0)
  • 2021-02-11 11:01

    you can add the private framework by jus drag and drop to your xcode project from /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/System/Library/PrivateFrameworks/GraphicsServices.framework and also import the #import "GraphicsServices.h" header in your .h file

    0 讨论(0)
提交回复
热议问题