SystemBarTint的使用
来源:互联网 发布:简单网络机房图片 编辑:程序博客网 时间:2024/06/09 19:26
SystemBarTint的使用
1、导入.jar包
compile ‘com.readystatesoftware.systembartint:systembartint:1.0.3’
2、xml布局文件修改
在Activity的布局文件里的顶层布局加代码,如下:
android:fitsSystemWindows=”true”
作用是让view可以根据系统窗口(如status bar)来调整自己的布局,如果值为true,就会调整view的paingding属性来给system windows留出空间。
3、Activity代码
private void setTranslucentSystemBar() {
SystemBarTintManager tintManager = new SystemBarTintManager(this);
tintManager.setStatusBarTintEnabled(true);
tintManager.setStatusBarTintColor(R.color.title_bar_bg);
// 4.4及以上版本开启
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
Window window = getWindow();
//透明状态栏
window.setFlags(
WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS,
WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
}
}
- SystemBarTint的使用
- SystemBarTint的使用(设置半透明状态栏)
- SystemBarTint的使用(设置半透明状态栏)
- SystemBarTint的使用(设置半透明状态栏)
- SystemBarTint的使用(设置半透明状态栏)
- 沉浸式状态栏的设定-com.readystatesoftware.systembartint:systembartint 的使用
- android透明状态栏与开源库SystemBarTint的使用
- 关于Android沉浸式通知栏的一个开源库SystemBarTint简单使用
- 关于Android沉浸式通知栏的一个开源库SystemBarTint简单使用
- 关于Android沉浸式通知栏的一个开源库SystemBarTint简单使用
- 很好的一个沉浸式效果 (使用第三方 SystemBarTint)
- Android系统透明栏(Translucent Bars)使用SystemBarTint的实现攻略
- Android沉浸式通知栏的一个开源库SystemBarTint简单使用,android沉浸式状态栏
- Android 使用SystemBarTint设置状态栏颜色
- Android 使用SystemBarTint设置状态栏颜色
- Android沉浸式状态栏SystemBarTint的使用方法
- Android沉浸式状态栏SystemBarTint的使用方法
- Android沉浸式状态栏SystemBarTint的使用方法
- iOS 决策app -记录决策过程,制定更理性决策的工具
- document.write()覆盖页面
- 虚幻引擎4.14版正式发布 继续优化对VR开发的支持
- 最小二乘法与梯度下降法的区别?
- 用数组的方式查找重复出现的数字及下标
- SystemBarTint的使用
- 《Android开发艺术探索》第十章Android的消息机制、十一章线程和线程池小结
- javascript小结
- 一.d3.js 数据可视化
- java 图形界面
- windows下OpenCV的编译与配置过程(Qt)
- 矢量图标字体自定义li编号样式
- PHP和Html中绝对路径和相对路径的问题
- sqlserver中 REPLACE的用法