设置顶部系统栏颜色和actionbar颜色相同
2015-03-29 12:47
281 查看
在activity中调用以下方法:
/** * Apply KitKat specific translucency. */ private void applyKitKatTranslucency() { // KitKat translucent navigation/status bar. if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { setTranslucentStatus(true); SystemBarTintManager mTintManager = new SystemBarTintManager(this); mTintManager.setStatusBarTintEnabled(true); mTintManager.setNavigationBarTintEnabled(true); mTintManager.setTintColor(getResources().getColor(R.color.actionbar_background)); } } @TargetApi(19) private void setTranslucentStatus(boolean on) { Window win = getWindow(); WindowManager.LayoutParams winParams = win.getAttributes(); final int bits = WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS; if (on) { winParams.flags |= bits; } else { winParams.flags &= ~bits; } win.setAttributes(winParams); }
相关文章推荐
- 沉浸式状态栏 设置顶部系统栏颜色和actionbar颜色相同
- Extended ActionBar沉浸式状态栏(顶部状态栏填充与actionBar颜色相同)
- 低版本系统兼容的ActionBar(一)设置颜色+添加Menu+添加ActionMode
- iOS平台设置系统状态栏(通知栏、顶部状态栏)样式背景颜色或透明
- actionbar和actionbar上title的颜色设置
- 编程把系统窗口背景颜色设置成护眼的淡绿色
- 系统设置技巧 变换常见文件夹颜色
- 当前ViewGroup背景设置系统背景并增加颜色滤镜效果
- Ubuntu 系统颜色颜色设置
- android中actionBar中字体颜色设置
- 如何自定义设置系统中Tabbar上的文字和图标的颜色
- iOS 设置系统返回按钮的颜色
- ubuntu系统修改终端提示符及设置颜色高亮
- 获取系统调色板颜色,并设置
- swift开发笔记1-设置顶部导航条背景色和字体颜色
- ActionBar简单的背景颜色设置
- 设置IOS 6.0顶部导航条颜色,和全屏开启应用,横竖屏选择
- android中actionBar中字体颜色设置
- VS2010和选中代码相同的代码的颜色设置,修改高亮颜色
- Swing制作高仿QQ界面包含主界面、聊天窗口、系统设置窗口|圆角界面|透明|颜色|渲染|换肤