系统版本6.0及以上设置沉浸式状态栏代码。
requestWindowFeature(Window.FEATURE_NO_TITLE); //系统版本6.0及以上设置沉浸式状态栏 if (RomUtil.hasM()) { int flag = getWindow().getDecorView().getSystemUiVisibility(); flag |= (WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); getWindow().setStatusBarColor(Color.WHITE); getWindow().getDecorView().setSystemUiVisibility(flag); }