// Hide both the navigation bar and the status bar.
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
// Hide Action bar.
ActionBar actionBar = getSupportActionBar();
// Notice:Replace getSupportActionBar() with getActionBar() if you aren't using androidx...
if (actionBar != null) {
actionBar.hide();
}
Android 11隐藏状态栏和导航栏
最新推荐文章于 2024-05-17 02:26:07 发布