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.
有没有办法通过顶部的电源按钮确定屏幕是否已关闭?
我只需要知道屏幕是否以某种方式设置为关闭以终止更新位置的循环。
谢谢
您的应用程序委托将applicationWillResignActive:在屏幕锁定之前(或者当电话响铃或弹出另一个窗口时)收到一条消息。这是杀死任何空闲时间进程的绝佳时机。重新激活后,您会收到一条applicationDidBecomeActive:消息,您可以在其中重新启动所有这些东西。
applicationWillResignActive:
applicationDidBecomeActive: