setContentView(R.layout.activity_main);
// 实现沉浸式状态栏
//if (Build.VERSION.SDK_INT >= 21) {
// View decorView = getWindow().getDecorView();
// int option = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
// decorView.setSystemUiVisibility(option);
// getWindow().setStatusBarColor(Color.TRANSPARENT);
// 半透明
View decorView = getWindow().getDecorView();
int option = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
decorView.setSystemUiVisibility(option);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
}
// 下面看实际 是否需要
//ActionBar actionBar = getSupportActionBar();
//actionBar.hide();
网友评论