android app开发全屏显示
方法1,api26 android8.0
// 隐藏标题栏 supportRequestWindowFeature(Window.FEATURE_NO_TITLE); View decorView = getWindow().getDecorView(); int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_STABLE; decorView.setSystemUiVisibility(uiOptions); // 隐藏 ActionBar if (getSupportActionBar() != null) { getSupportActionBar().hide(); }
方法2
// 隐藏标题栏 supportRequestWindowFeature(Window.FEATURE_NO_TITLE); // 隐藏状态栏 getWindow().setFlags( WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN );
欢迎讨论,相互学习。
cdtxw@foxmail.com

浙公网安备 33010602011771号