iOS   发布时间:2022-03-30  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了ios – 暂停事件在PhoneGap iPhone中无法正常工作?大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
这是我的代码

//This is an event that fires when a PhoneGap application is put into the BACkground.
    document.addEventListener("pause",onPause,falsE);

    //This is an event that fires when a PhoneGap application is retrieved from the BACkground.
    document.addEventListener("resume",onResume,falsE);

    // Handle the pause event
    function onPause(){
    console.log("pause : app is put into BACkground");
    }


    // Handle the resume event
    function onResume() {
    console.log("resume : app is put into foreground");
    }

当我按下主页按钮时,控制台中没有日志,但是当我单击应用程序(将其置于前台)时,我的日志就是

2011-11-22 12:11:37.206 Event[644:207] [INFO] pause : app is put into BACkground
2011-11-22 12:11:37.206 Event[644:207] [INFO] resume : app is put into foreground

我不知道为什么暂停函数在前景中被调用.
有什么我做错了吗?

解决方法

这是来自文档

iOS Quirks

大佬总结

以上是大佬教程为你收集整理的ios – 暂停事件在PhoneGap iPhone中无法正常工作?全部内容,希望文章能够帮你解决ios – 暂停事件在PhoneGap iPhone中无法正常工作?所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。