Android 隐藏 返回键 Home键 隐藏最下面的NAVIGATION栏

需要4.0以上
1.在setContentView前面加上(这种方式,点击屏幕的时候会弹出)

WindowManager.LayoutParams params = getWindow().getAttributes();
params.systemUiVisibility = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
getWindow().setAttributes(params);

2.点击屏幕也不弹出

 //让虚拟键一直不显示
Window window = getWindow();
WindowManager.LayoutParams params = window.getAttributes();
params.systemUiVisibility = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION|View.SYSTEM_UI_FLAG_IMMERSIVE;
window.setAttributes(params);
发布了184 篇原创文章 · 获赞 70 · 访问量 37万+

猜你喜欢

转载自blog.csdn.net/qq_31939617/article/details/95189688
今日推荐