相关疑难解决方法(0)

暂停事件在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");
    }
Run Code Online (Sandbox Code Playgroud)

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

2011-11-22 12:11:37.206 Event[644:207] [INFO] pause : app is put into background …
Run Code Online (Sandbox Code Playgroud)

iphone ios phonegap-plugins cordova

4
推荐指数
1
解决办法
6356
查看次数

标签 统计

cordova ×1

ios ×1

iphone ×1

phonegap-plugins ×1