[英]ios double click home button event
Is there anyway to capture double click home button event. 无论如何,有捕获双击主页按钮事件。
I know it will run into applicationWillResignActive, but there are many situations that application will run into applicationWillResignActive so I can NOT distinguish the double click home button event with other events. 我知道它将运行到applicationWillResignActive中,但是在很多情况下应用程序将运行到applicationWillResignActive中,因此我无法将双击主页按钮事件与其他事件区分开。
Can anybody give me some hints? 有人可以给我一些提示吗?
My app is meeting a bug: - On iOS 7, when double click home button, you can see running app with their current images. 我的应用程序遇到一个错误:-在iOS 7上,双击主页按钮,您可以看到正在运行的应用程序及其当前图像。 Because my app have some protection (I built a passcode view), so when user home button or double click home button, I will capture event to show my passcode view first.
因为我的应用程序具有一定的保护功能(我构建了密码视图),所以当用户使用主页按钮或双击主页按钮时,我将捕获事件以首先显示密码视图。 To do this, I place my code to show passcode on applicationWillResignActive.
为此,我将代码放置在applicationWillResignActive上以显示密码。
No there is not. 不,那里没有。
Apple just don't allow you to access their hardware. Apple只是不允许您访问其硬件。 The only thing you can do is to use frameworks to accsess those hardware.
您唯一可以做的就是使用框架来控制那些硬件。 If there isn't any framework for that, there is just no way to do this without coding for jailbreak or something.
如果没有任何框架,那么没有编码越狱之类的东西就没有办法。
You can think about layers of the software. 您可以考虑软件的各个层。
The core frameworks give you the closes freature to code for the hardware. 核心框架为您提供了编写硬件代码的基础。
You can't access any button clicks on the home button. 您无法访问主页按钮上的任何按钮单击。
When it goes into applicationWillResignActive
that's as a secondary result of the button click. 当它进入
applicationWillResignActive
,这是按钮单击的次要结果。 Not a direct result. 不是直接的结果。
ie the button is clicked, the OS interprets the click, then tells your app to go into background, then you get applicationWillResignActive
. 即单击按钮,操作系统解释该单击,然后告诉您的应用进入后台,然后您获得
applicationWillResignActive
。
Same when you receive a phone call etc... 收到电话等时也是如此...
There's no way of specifically detecting a double tap on the home button. 无法专门检测主页按钮上的双击。
As you note, you should respond to applicationWillResignActive
. 如您所述,您应该响应
applicationWillResignActive
。
What are you actually trying to achieve? 您实际上想达到什么目的?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.