iOS的phonegap中是否退出按钮事件? [英] exit button event in phonegap for iOS?
本文介绍了iOS的phonegap中是否退出按钮事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我们在phonegap中按下iPhone的关闭按钮时,是否有任何事件监听器会调用?
is there any event Listener that calls when we press on iPhone close button in phonegap?
以便我们可以在应用程序关闭时完成最终任务.
so that we can do final task when application close.
我发现网页重定向时会调用onunload方法,但它需要在这里工作.
i have found that onunload method will call when webpage redirect but it want work here.
请帮助我.
推荐答案
您可以收听Phonegap的暂停"事件:
You can listen to Phonegap's "pause" event:
document.addEventListener("pause", yourCallbackFunction, false);
http://docs.phonegap.com/en/2.9.0/cordova_events_events.md.html#pause
这篇关于iOS的phonegap中是否退出按钮事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文