android状态栏透明
来源:互联网 发布:阿里云私有ip怎么用 编辑:程序博客网 时间:2024/04/30 10:28
实现步骤:
1、下载第三方开源库https://github.com/jgilfelt/SystemBarTint(注意事项,V19以上才会出现透明)
2、项目目录res下新建values-v19文件夹,添加style.xml文件,内容如下
<resources>
<!-- Base application theme. -->
<style name="AppTheme"parent="android:Theme.Holo.Light.NoActionBar.TranslucentDecor">
<!-- Customize your theme here. -->
</style>
</resources>
3、Activity中设置状态栏透明,显示根布局的背景图片
废话少说上效果图:
实现步骤:
1、下载第三方开源库https://github.com/jgilfelt/SystemBarTint(注意事项,V19以上才会出现透明)
2、项目目录res下新建values-v19文件夹,添加style.xml文件,内容如下
<resources>
<!-- Base application theme. -->
<style name="AppTheme"parent="android:Theme.Holo.Light.NoActionBar.TranslucentDecor">
<!-- Customize your theme here. -->
</style>
</resources>
3、Activity中设置状态栏透明,显示根布局的背景图片
//调整根布局如下属性
android:fitsSystemWindows="true"
android:clipToPadding="true"//设置根布局背景
android:background="@mipmap/bg"
-----------------------------------------------------------设置状态栏透明结束,我是分割线----------------------------------------------------------------
另外,如果要在Activity中设置状态栏颜色,onCreate中调用改方法即可
/**
* setSystemTintBar
* 设置状态栏颜色
* */
protected void setSystemTintBar(){
// create our manager instance after the content view is set
tintManager= new SystemBarTintManager(this);
// enable status bar tint
tintManager.setStatusBarTintEnabled(true);
// enable navigation bar tint
tintManager.setNavigationBarTintEnabled(true);
// set a custom tint color for all system bars
tintManager.setStatusBarTintColor(getResources().getColor(R.color.navigation_bar_bg));
}
- android 透明状态栏,沉浸状态栏
- Android状态栏着色-透明状态栏
- Android 透明状态栏实现
- android 全透明状态栏
- 设置android 状态栏透明
- Android 状态栏透明
- android透明状态栏
- android沉浸(透明状态栏)
- android状态栏透明
- android 全透明状态栏
- android 状态栏全透明
- android设置状态栏透明
- android透明状态栏
- Android实现透明状态栏
- Android沉浸(透明状态栏)
- android透明状态栏
- Android透明状态栏
- Android透明状态栏
- hdoj 1392 Surround the Trees 【求凸包周长】
- mysql 用户权限管理
- 【笔试面试考试】x&(x-1);
- 110. Balanced Binary Tree
- USB OTG to PC USB API简介
- android状态栏透明
- java 多态相关说明
- SVN命令以及ubuntu下SVN的安装
- 裁剪圆形图片
- 红皮书总结
- OpenGL(3)超级宝典笔记——GLSL语言基础
- 易语言注册码网络验证码自制
- linux下的环境的部署 jdk tomcat
- 《编程珠玑》读书笔记——第一章.开篇