Changing Backlight Level, iPhone

后端 未结 2 483
甜味超标
甜味超标 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.

提交回复
热议问题