質問

Possible Duplicate:
How do I prevent the iPhone screen from dimming or turning off while my application is running?

I am working on a timer app and was wondering if there is a way to tell iOS not to start the screensaver when the app is idle (e.g. timer laying on the table).

I would also like to keep the screen brightness at maximum level.

Any suggestion?

役に立ちましたか?

解決

For disabling the screensaver, try this:

[UIApplication sharedApplication].idleTimerDisabled = YES;

For adjusting the brightness of the screen (iOS5 and later only, previously there was no public API for this):

[[UIScreen mainScreen] setBrightness:1.0];
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top