Android沉浸式状态栏

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {

//透明状态栏

getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);

//透明导航栏

getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);

}

 Android 4.4开始

你可能感兴趣的:(Android沉浸式状态栏)