// 设置状态栏字体颜色
View stateView = getWindow().getDecorView();
if(stateView != null){
int vis = stateView.getSystemUiVisibility();
//vis |= View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR; //黑色
vis &= ~View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR; //白色
stateView.setSystemUiVisibility(vis);//设置状态栏字体颜色
}
// 修改状态栏背景颜色
getWindow().setStatusBarColor(getColor(R.color.colorPrimary));
网友评论