简单实现沉浸式状态栏
来源:互联网 发布:怎么设置ad网络的大小 编辑:程序博客网 时间:2024/06/01 17:21
public static void MyWi(Activity activity){
Window window = activity.getWindow();
// 对SDK版本进行判断,大于19执行此代码
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
//透明状态栏
window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
//透明导航栏
window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
SystemBarTintManager tintManager = new SystemBarTintManager(activity);
// 激活状态栏
tintManager.setStatusBarTintEnabled(true);
// enable navigation bar tint 激活导航栏
tintManager.setNavigationBarTintEnabled(true);
//设置系统栏设置颜色
//tintManager.setTintColor(R.color.red);
//给状态栏设置颜色
tintManager.setStatusBarTintResource(R.color.umeng_comm_green);//在colors里添加自定义颜色
//Apply the specified drawable or color resource to the system navigation bar.
//给导航栏设置资源
tintManager.setNavigationBarTintResource(R.color.umeng_comm_green);
}
}
Window window = activity.getWindow();
// 对SDK版本进行判断,大于19执行此代码
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
//透明状态栏
window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
//透明导航栏
window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
SystemBarTintManager tintManager = new SystemBarTintManager(activity);
// 激活状态栏
tintManager.setStatusBarTintEnabled(true);
// enable navigation bar tint 激活导航栏
tintManager.setNavigationBarTintEnabled(true);
//设置系统栏设置颜色
//tintManager.setTintColor(R.color.red);
//给状态栏设置颜色
tintManager.setStatusBarTintResource(R.color.umeng_comm_green);//在colors里添加自定义颜色
//Apply the specified drawable or color resource to the system navigation bar.
//给导航栏设置资源
tintManager.setNavigationBarTintResource(R.color.umeng_comm_green);
}
}
阅读全文
1 0
- 简单实现沉浸式状态栏
- android 最简单实现沉浸式状态栏
- Android沉浸式状态栏简单实现
- Android沉浸式状态栏的简单实现
- Android沉浸式状态栏的简单实现
- 沉浸式状态栏效果的简单实现
- android沉浸式状态栏简单实现
- Android 沉浸式状态栏的简单实现
- 简单使用style实现沉浸式状态栏
- Android_简单实现沉浸式状态栏
- 沉浸式状态栏(修改状态栏)颜色的简单实现
- 沉浸式状态栏实现
- 沉浸式状态栏实现
- 沉浸式状态栏实现
- 沉浸式状态栏实现
- 实现沉浸式状态栏
- android沉浸式状态栏的最简单实现
- android沉浸式状态栏的最简单实现
- Hadoop新手学习指导-hadoop核心知识学习
- Attribute application@allowBackup value=(true) from AndroidManifest.xml 报错
- Elasticsearch之查询与过滤。
- SUN:EL函数库
- 未解决的问题
- 简单实现沉浸式状态栏
- aop-自定义切点的方法
- android平台camera基础知识总结
- Android 中PopupWindow使用
- ubuntu-tab空格修改
- sudo apt-get update时出现e-appstreamcli
- 强化学习之DQN
- LoRa学习:LoRa通信调制解调的实现原理与性能
- JAVA 并发类(一) 常用的并发类