开发者

How to set brigtness of ipad or iphone by programming?

开发者 https://www.devze.com 2023-01-02 10:58 出处:网络
I have implementing pdf application for ipad.Now i want to set brightness in my a开发者_Python百科pplication.Is it possible?Please help me for this problem.

I have implementing pdf application for ipad.Now i want to set brightness in my a开发者_Python百科pplication.Is it possible?Please help me for this problem.

Thanks in advance.


Most applications that you see with this feature are putting up a full screen solid black view or window and adjusting the alpha level. The brightness is then adjusted from some minimum value to the current system maximum. The actual system brightness cannot be accessed by a sandboxed application.

UIWindow *shader = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds];
shader.backgroundColor = [UIColor blackColor];
shader.alpha = 0.1;

With a view, you have the option of being behind things like toolbars. With a window, you can be over everything if you set the window level high enough. Do not let the alpha level go above 0.5 or whatever you choose as your limit.


short answer: you can't in the official sdk.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号