Translucent system UI styling
To get the most impact out of your content, you can now use new window styles and themes to request translucent system UI, including both the status bar and navigation bar. To ensure the legibility of navigation bar buttons or status bar information, subtle gradients is shown behind the system bars. A typical use-case would be an app that needs to show through to a wallpaper.

这个是Android Developer上的原文 反正我也看得不是很懂 我知道的就是实现和导航栏和状态栏的透明 带一些渐变效果

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(, config.getPixelInsetTop(true), , 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

最新文章

  1. MathType for mac 能够实现在Word里面双击公式编辑的方法
  2. how to build apache log4cxx 0.10 by Visual Studio 201*
  3. Linux硬链接与软连接
  4. Linux Shell编程(16)——循环
  5. eclipse 导入git库 Android工程
  6. 201521123002《Java程序设计》第8周学习总结
  7. c# aynsc 和 await
  8. 图的BFS----迷宫问题
  9. jenkins的安装部署
  10. android_安装包_NoClassDefFoundError
  11. Python配置工具类ConfigParser使用
  12. windows10+Python3.6+Anaconda3+tensorflow1.10.0配置和安装
  13. node的http请求
  14. Linux下替换默认版本的protobuf
  15. Oracle Sequence Cache 参数说明
  16. 命令行Scp的使用----远程拷贝文件
  17. Farthest Nodes in a Tree ---LightOj1094(树的直径)
  18. AnimationState
  19. VS2017 Use Git Push To TFS2018 Failure
  20. MemoryStream类读写内存

热门文章

  1. TCP/IP源码(59)——TCP中的三个接收队列
  2. jboss7 Java API for RESTful Web Services (JAX-RS) 官方文档
  3. Android -- 利用Broadcast开启Service(转)
  4. POJ 1584 A Round Peg in a Ground Hole 判断凸多边形,判断点在凸多边形内
  5. Python之路,Day21 - 常用算法学习
  6. codevs3304水果姐逛水果街
  7. 【转】JAVA的StringBuffer类
  8. Linq101-Restriction
  9. flash文件运动节奏的控制
  10. AFN发送请求失败