新需求:删除Android 原生自带的虚拟导航按键(暂定)
如想直接删除不显示Navigationbar,可以用如下两个方法
1)在资源xml文件中把导航按键的高度和宽度设置为0
frameworks/base/core/res/res/values/dimens.xml
<dimen name="navigation_bar_height">0dp</dimen>
<!-- Height of the bottom navigation bar in portrait; often the same as @dimen/navigation_bar_height -->
<dimen name="navigation_bar_height_landscape">0dp</dimen>
在配置文件中设置config_showNavigationBar=false
frameworks/base/core/res/res/values/config.xml设置为false
SystemProperties.get("qemu.hw.mainkeys");1为关,0为开
源码判断方法
mHasNavigationBar = res.getBoolean(com.android.internal.R.bool.config_showNavigationBar);
// Allow a system property to override this. Used by the emulator.
// See also hasNavigationBar().
String navBarOverride = SystemProperties.get("qemu.hw.mainkeys");
if ("1".equals(navBarOverride)) {
mHasNavigationBar = false;
} else if ("0".