Android状态栏透明,带有导航抽屉-Appbar高程 [英] Android Status Bar transparent with Navigation Drawer - Appbar elevation

查看:215
本文介绍了Android状态栏透明,带有导航抽屉-Appbar高程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在根据材料设计准则开发应用程序.我有一个由Android Studio创建的样板应用程序. 由于某种原因,状态栏的底部略有倾斜,从而使应用栏(工具栏)的错觉比状态栏的高度更高.

I am working on an app with Material Design Guidelines. I have a boilerplate app created by Android Studio. For some reason the status bar has a little gradient at the bottom which creates an illusion of Appbar (Toolbar) being on a higher elevation than status bar.

我看了克里斯·贝恩(Cheer Bane)的Cheesesquare 应用作为参考,看起来他为达到该目的正在做任何特殊的事情.

I took a look on Chris Bane's Cheesesquare app for reference and it doesn't look like he is doing anything special to achieve that.

以下是供您参考的屏幕截图-

Here are the screenshots for reference -

样板程序

Cheesesquare应用

请注意,Cheesesquare应用程序的状态栏和应用程序栏感觉就像在同一海拔高度上,只是具有不同的紫色阴影.而我的应用程序"的状态栏感觉好像比应用程序栏的高度低.

Notice that Cheesesquare app's status bar and app bar feel like on the same elevation with just different shades of purple. Whereas My Application's status bar feels like it lies at lower elevation than the app bar.

样板代码包含以下代码段

Boilerplate code has following snippet of code in

v21/styles.xml

v21/styles.xml

<style name="AppTheme.NoActionBar">
    <item name="windowActionBar">false</item>
    <item name="windowNoTitle">true</item>
    <item name="android:windowDrawsSystemBarBackgrounds">true</item>
    <item name="android:statusBarColor">@android:color/transparent</item>
</style>

如何获得Cheesesquare应用程序的感觉?

How can I achieve the feel of Cheesesquare app?

P.S.我正在使用刚刚发布(2016年2月)的Android支持库23.2

P.S. I am using Android Support Library 23.2 that was just released (Feb 2016)

推荐答案

在工具栏中添加此行

app:elevation="0dp"

这篇关于Android状态栏透明,带有导航抽屉-Appbar高程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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