android 4.4 状态栏隐藏
2015-09-30 14:23
447 查看
这个是Android Developer上的原文 反正我也看得不是很懂 我知道的就是实现和导航栏和状态栏的透明 带一些渐变效果
添加了这两个属性之后 就是是这个效果了 可以看到 listview已经被顶到上面去了 不知道是不是bug 查了下资料 目前的解决办法好像都是给layout设置padding来解决
http://stackoverflow.com/questions/20781014/translucent-system-bars-and-content-margin-in-kitkat
1. 设置主题
<style name="Theme.Timetodo" parent="@android:style/Theme.Holo.Light"> <!-- translucent system bars --> <item name="android:windowTranslucentStatus">true</item> <item name="android:windowTranslucentNavigation">true</item> </style>
添加了这两个属性之后 就是是这个效果了 可以看到 listview已经被顶到上面去了 不知道是不是bug 查了下资料 目前的解决办法好像都是给layout设置padding来解决
2.设置颜色和设置padding
private void initSystemBar() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { setTranslucentStatus(true); SystemBarTintManager tintManager = new SystemBarTintManager(this); tintManager.setStatusBarTintEnabled(true); tintManager.setStatusBarTintResource(R.color.actionbar_bg); SystemBarConfig config = tintManager.getConfig(); listViewDrawer.setPadding(0, config.getPixelInsetTop(true), 0, config.getPixelInsetBottom()); } }
3.最终效果
参考资料:
http://mindofaandroiddev.wordpress.com/2013/12/28/making-the-status-bar-and-navigation-bar-transparent-with-a-listview-on-android-4-4-kitkat/http://stackoverflow.com/questions/20781014/translucent-system-bars-and-content-margin-in-kitkat
相关文章推荐
- android中代码混淆
- Android studio报错 Error retrieving parent for item: No resource found that matches the given name ...
- android
- android ViewPager滑动事件讲解
- 【Android】解决在Android虚拟机中安装apk报error:protocol faultno status或error:device not found问题
- android-----ListView和GridView的用法
- AndroidStudio快捷键
- android:scrollbarStyle属性
- Android Studio 中ADB WIFI 插件的使用
- Android Studio安装后提示No JVM installation found解决办法
- android 5.1 中添加显示运营商的控制
- android 页面停几秒后跳转
- Android(java方法)上实现mp4的分割和拼接 (一)
- android Fragment真正的完全解析(下)
- Android Fragment的完全解析(上)
- 关于陌陌签名验证机制的研究
- 使用FlowDroid生成Android应用程序的函数调用图
- Android-Universal-Image-Loader 图片加载库
- 关于android下的raw文件的问题
- Android自定义控件之组合控件