android - 自定义状态栏通知 Android 中的空白

标签 android android-custom-view

我的背景颜色没有填满自定义 Statusbar View 中的整个布局。知道为什么吗?

这是屏幕截图(已更新以简化):

enter image description here

在空白的黑色区域右侧有一个空白填充。这是完整的布局:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#ff000000"
    android:scrollbars="none"></LinearLayout>

有人可以帮忙吗?

最佳答案

我直接与 Google 开发人员交谈,这就是这个 View 的目的。因为我选择了黑色背景,所以它是可见的。 Google 建议坚持使用默认背景颜色,这样就不会显示此空间。

关于android - 自定义状态栏通知 Android 中的空白,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6819858/

相关文章:

java - Android中的画笔动画效果

android - 如何在 Android Studio 中使用 ffmpeg?我收到一个损坏的文件

java - 如何显示来自后台线程的 toast 消息

android - 如何使用自定义选择器状态实现 CustomView?

android - EditText 的子类看起来与 Android 4 上的普通 EditText 不同

java - 油煎面包 block 居中自定义 View 和消失问题

背景为黑色时,Android PorterDuff.Mode.CLEAR 无法正常工作

java - 如何以编程方式更改背景形状的颜色

android - 像listview一样鼓掌

android - 从 xml 布局文件创建自定义 View 类的最佳方法?