android - 状态栏上的图像叠加

标签 android overlay statusbar

我在状态栏上添加了主要的深色,使其成为我工具栏的颜色。

Coloured Status Bar

但是我有一个向上滑动面板,顶部有一个图像(屏幕截图),我需要将其叠加到状态栏上。它目前像下面的截图。 Should be overlaying the image

最佳答案

将以下内容放入您的 AppTheme 样式中的 values-v21 文件夹 (styles.xml) 中:

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="android:windowDrawsSystemBarBackgrounds">true</item>
    <item name="android:statusBarColor">@android:color/transparent</item>
</style>

默认情况下,状态栏颜色由“colorPrimaryDark”决定。将上述主题应用于 androidManifest.xml 中的特定 Activity 。 (父主题可以是任何东西)

关于android - 状态栏上的图像叠加,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31006605/

相关文章:

Java import com.google 无法解析

android - 如何在android中获取可扩展 ListView 的子值?

java - 如何限制每次 session 的广告数量?

android - 使用 USB 电缆连接时,有时无法在 Eclipse 中检测到设备

c# - MinWidth 无效

iphone - 检查状态栏是否隐藏或可见

android - 覆盖图像以在 Android 应用程序中制作教程

android - RelativeLayout TextView 覆盖

ios - UIImagePickerControler.Camera 上的简单叠加 View

IOS 警告 : Unable to allocate render buffer storage