How to set brigtness of ipad or iphone by programming?
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.
精彩评论