Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在开发一个应用程序来测试 iphone 屏幕是关闭还是打开,我尝试了堆栈溢出中指定的加速度计代码,它在屏幕开启状态下运行良好,但是当我关闭屏幕时,加速度计没有停用。
所以我开始怀疑当屏幕关闭时加速度计是否会自动停用。如果有人对此有明确的想法,请分享。
谢谢
应用程序在睡眠时暂停。你应该为它实现一个后台任务。
https://developer.apple.com/library/ios/DOCUMENTATION/iPhone/Conceptual/iPhoneOSProgrammingGuide/ManagingYourApplicationsFlow/ManagingYourApplicationsFlow.html#//apple_ref/doc/uid/TP40007072-CH4-SW20