Prevent iPhone auto-lock, but permit screen dimming

三世轮回 提交于 2019-12-22 05:33:08

问题


I have an application which works in a hands busy environment so the user rarely touches the device. Of course, the phone goes into auto-lock and my app stops working. I used this code:

    [[UIApplication sharedApplication] setIdleTimerDisabled:YES];

to prevent the device and that is fine. However, I would still like the screen to auto-dim. The above code keeps the screen from auto-dimming as well as auto-locking.

This question shows me how I can dim the screen manually, and that just may be a good enough solution. But I'd rather use system settings, not app settings.

So how can I prevent auto-lock while still getting the auto-dim?

来源:https://stackoverflow.com/questions/15668840/prevent-iphone-auto-lock-but-permit-screen-dimming

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!