简体   繁体   English

为什么状态栏出现阴影?

[英]Why Status bar is appearing with shadow?

Status bar of my app is not seem as clear or it appears with some shadow. 我的应用程序的状态栏看起来不清晰或带有阴影。

This is how my status bar looks: 这是我的状态栏的外观:

在此处输入图片说明

And it should appear like this: 它应该看起来像这样:

在此处输入图片说明

Why it isn't looking like this? 为什么看起来不是这样?

style.xml style.xml

<resources>

    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
        <item name="windowActionBarOverlay">false</item>
        <item name="windowActionBar">false</item>
        <item name="android:windowBackground">@android:color/white</item>\

    </style>
    <style name="AppTheme.NoActionBar">
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>
    </style>
    <style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
    <style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />

</resources>

What's wrong with this? 这怎么了 Please help.. 请帮忙..

Delete this line 删除这行

<item name="android:statusBarColor">@android:color/transparent</item>

from your values-v21/styles.xml 从您的价值观-v21 / styles.xml

If you are in android 5 or later you can set the elevation of the actionbar to 0 by below code 如果您使用的是Android 5或更高版本,则可以通过以下代码将操作栏的高度设置为0

getSupportActionBar().setElevation(0);

If not 5 or higher then add below style in your theme 如果不是5或更高,请在主题中添加以下样式

<style name="MyAppTheme" parent="android:Theme.Holo.Light">
<item name="android:windowContentOverlay">@null</item>
</style>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM