2.由于加入透明状态栏后,会使页面整个布局往上移动,要想使页面位置不变,就需要在整个页面布局之上中加入
private void initSystemBar() {
if (Build.VERSION.SDK_INT >=
Build.VERSION_CODES.KITKAT) {
setTranslucentStatus(true);
SystemBarTintManagertintManager =
new SystemBarTintManager(this);
tintManager.setStatusBarTintEnabled(true);
//设置颜色
//tintManager.setTintColor();
tintManager.setStatusBarTintResource(
R.color.actionbar_bg);
SystemBarConfigconfig =
tintManager.getConfig();
//设置Padding
listViewDrawer.setPadding(0,
config.getPixelInsetTop(true),0,
config.getPixelInsetBottom());
}
}