如何使导航栏透明 [英] How to make the navigation bar transparent

查看:180
本文介绍了如何使导航栏透明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何才能在Android 4.4.X及以上的导航栏透明?

How can I make the navigation bar transparent on Android 4.4.X and above?

我有搜索的文档中,却发现没有这个问题。

I have searched in the documentation, but found nothing about this.

推荐答案

我已经采取了这一从更改日志中的 Android的奇巧(4.4)

I have taken this from the change log for Android KitKat (4.4):

半透明系统酒吧

现在,您可以使系统栏部分透明的新主题,<一个href="http://developer.android.com/reference/android/R.style.html#Theme_Holo_NoActionBar_TranslucentDecor"相对=nofollow> Theme.Holo.NoActionBar.TranslucentDecor 和<一href="http://developer.android.com/reference/android/R.style.html#Theme_Holo_Light_NoActionBar_TranslucentDecor"相对=nofollow> 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.

希望这有助于让你开始。

Hope this helps get you started.

这篇关于如何使导航栏透明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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