How do I remove the navigation bar from my Android build?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-11 09:06:57

问题


Since the device I am developing has physical buttons, I do not want to see a navigation bar taking up my screen space. Rowboat-android on Beagleboneblack shows the navigation bar by default. Where do I turn it off?

EDIT: I am not developing applications. I am developing a Beaglebone based device. I want to remove the bar globally from the system. Somewhere there should be a code or setting in the Android source.


回答1:


Found the answer at Building a wireless Android device using BeagleBone Black

Basically I edited device/ti/beagleboneblack/overlay/frameworks/base/core/res/res/values/config.xml file to set this entry:

    <bool name="config_showNavigationBar">false</bool>



回答2:


You should use IMMERSIVE flag like this:

private void hideSystemUI() {
    mDecorView.setSystemUiVisibility(
            View.SYSTEM_UI_FLAG_LAYOUT_STABLE
            | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
            | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
            | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav bar
            | View.SYSTEM_UI_FLAG_FULLSCREEN // hide status bar
            | View.SYSTEM_UI_FLAG_IMMERSIVE);
}

For more info, I recommend you to take a look at here.



来源:https://stackoverflow.com/questions/24286986/how-do-i-remove-the-navigation-bar-from-my-android-build

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!