修改statusbar 和 actionbar颜色

  //设置statusbar颜色
        Window window = this.getWindow();
        window.getDecorView().setSystemUiVisibility( View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN| View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
        window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
        window.setStatusBarColor(this.getResources().getColor(R.color.login_statusbar));
        //设置actionbar颜色
        int color = Color.parseColor("#aaaaaa");
        ColorDrawable drawable = new ColorDrawable(color);
        actionBar.setBackgroundDrawable(drawable);

猜你喜欢

转载自blog.csdn.net/Moty12/article/details/80985745
今日推荐