透明状态栏/system-ui on 4.4 Kit Kat [英] transparent status-bar / system-ui on 4.4 Kit Kat

查看:27
本文介绍了透明状态栏/system-ui on 4.4 Kit Kat的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这在 4.4 中肯定是可能的,但我还没有找到关于此的文档 - 有谁知道如何使状态栏/系统用户界面透明/半透明?

This must be possible with 4.4, but I found no documentation on this yet - anyone knows how to make the status-bar / system-ui transparent/translucent ?

推荐答案

给你 - http://developer.android.com/about/versions/android-4.4.html#UI

半透明的系统栏

您现在可以使用新的系统栏部分半透明主题,Theme.Holo.NoActionBar.TranslucentDecor 和Theme.Holo.Light.NoActionBar.TranslucentDecor.通过启用半透明系统栏,您的布局将填充系统栏后面的区域,因此您还必须为布局的一部分启用 fitsSystemWindows不应该被系统栏覆盖.

You can now make the system bars partially translucent with new themes, Theme.Holo.NoActionBar.TranslucentDecor and Theme.Holo.Light.NoActionBar.TranslucentDecor. By enabling translucent system bars, your layout will fill the area behind the system bars, so you must also enable fitsSystemWindows for the portion of your layout that should not be covered by the system bars.

如果您要创建自定义主题,请将这些主题之一设置为父主题或包含 windowTranslucentNavigation 和主题中的 windowTranslucentStatus 样式属性.

If you're creating a custom theme, set one of these themes as the parent theme or include the windowTranslucentNavigation and windowTranslucentStatus style properties in your theme.

这篇关于透明状态栏/system-ui on 4.4 Kit Kat的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆