Can the application know whether the Home button or the Power button was pressed?

依然范特西╮ 提交于 2019-12-07 17:33:52

问题


If either of buttons is pressed, both ApplicationWillResignActive and ApplicationDidEnterBackground methods are being called.
I want my application, on its way to the background, to respond differently to these buttons. Can that be done?
The problem is only in iOS 5. In previous versions of iOS, only ApplicationWillResigActive was called. Thanks


回答1:


It seems like the answer is no :(

I found this thread: Is it possible to distinguish between locking the device and sending an app to background?

And this one: https://devforums.apple.com/thread/119433



来源:https://stackoverflow.com/questions/7896095/can-the-application-know-whether-the-home-button-or-the-power-button-was-pressed

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