问题
I've made an app for Android using phonegap and i wanted to make it really full screen and hide/remove the buttons at the bottom of the screen (The back button, the home button and the app switcher button) I know this is possible because the BBC iPlayer app does it when you're viewing a video, but i dont know if it's possible with phonegap, Does anyone know if it is, and if so, could you point me in the right direction
回答1:
Not possible - I haven't used the BBC Sport app properly, but hazard a guess it uses the device's default player (which is an Android player) and thus this is the only desirable time you want full-screen mode.
Android relies on those buttons - otherwise, how can you exit the app? It's like the home button on iOS - you need it to operate the device.
There are event listeners you can use for the back button and menu button which you can override the default behaviour for:
document.addEventListener('backbutton', function () {
// do something when back is pressed
}, false);
document.addEventListener('menubutton', function () {
// do something when menu is pressed
}, false);
That's about it though. Think in terms of the Samsung Galaxy phones - these are hard buttons and so you can't 'hide' them like you can on stock Android.
来源:https://stackoverflow.com/questions/21574530/hide-on-screen-buttons-in-android-phonegap-app