android 改变状态栏(StatusBar)颜色

public static void changeColor(Activity paramActivity, int paramInt1) {
if (Build.VERSION.SDK_INT >= 21) {
paramActivity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
paramActivity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
paramActivity.getWindow().setStatusBarColor(paramInt1);
}
}
posted @ 2018-03-30 14:33  Alter  阅读(3080)  评论(0编辑  收藏  举报