Android修改状态栏颜色

http://www.jianshu.com/p/932568ed31af

状态栏颜色与toobal相同

@TargetApi(19)
private void initWindow() {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
    }
}

你可能感兴趣的:(android)