开发者

iOS power button, can the event of touching it be determined?

开发者 https://www.devze.com 2023-04-05 03:29 出处:网络
I\'d like to know if there\'s a way to determine if the power button was hit to \"clos开发者_运维技巧e\" the screen on the device.

I'd like to know if there's a way to determine if the power button was hit to "clos开发者_运维技巧e" the screen on the device.

Is there a way to determine this? I cannot use private api's.


I don't think you can tell if the button is pressed directly without using private APIs, however you might be able to use the applicationWillResignActive: method of the UIApplicationDelegate protocol to do what you need to do.

0

精彩评论

暂无评论...
验证码 换一张
取 消