半透明的导航栏 [英] Translucent navigation bar

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

问题描述

我希望将布局的内容显示在导航栏(也称为半透明导航栏)下.在互联网上阅读后,它说您要做的就是将这两项添加到应用于该活动的样式中:

I want to have the content of my layout being displayed under the navigation bar (also called translucent navigation bar). After reading on the internet, it says all you have to do is add this 2 items to style applied to the activity:

<item name="android:navigationBarColor">@android:color/transparent</item>
<item name="android:windowTranslucentNavigation">true</item>

结果是,导航栏为浅灰色而不是透明的.所有人如何解决这个问题?

The result is, that the navigation bar is light gray and not transparent. How do all the people solve this ?

推荐答案

问题是属性

android:fitsSystemWindows="true"

在我的布局的根视图中(这次是CoordinatorLayout).此属性可防止在状态和导航栏后面绘制布局的内容.

in the root view of my layout (in this time CoordinatorLayout). This attribute prevents the content of the layout to draw behind the status and navigation bar.

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

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