2011-12-20 81 views

回答

5

是的,看到的PhoneGap API: http://docs.phonegap.com/en/1.0.0/phonegap_events_events.md.html

// Call onDeviceReady when PhoneGap is loaded. 
// 
// At this point, the document has loaded but phonegap.js has not. 
// When PhoneGap is loaded and talking with the native device, 
// it will call the event `deviceready`. 
// 
document.addEventListener("deviceready", onDeviceReady, false); 

// PhoneGap is loaded and it is now safe to make calls PhoneGap methods 
// 
function onDeviceReady() { 
    // Register the event listener 
    document.addEventListener("backbutton", onBackKeyDown, false); 
} 

// Handle the back button 
// 
function onBackKeyDown() { 
} 
0

不存在不僅是一個傾聽者,但我認爲你可以通過使用onKeyDown()聽衆,甚至更好,你可以給人以onLongKeyDown()聽者設法讓自己長返回鍵收聽。 ..

祝你好運!

相關問題