【问题标题】:why can't I put any components on the navigation bar or on the status bar为什么我不能将任何组件放在导航栏或状态栏上
【发布时间】:2022-12-14 07:33:55
【问题描述】:

所有细节 想做一个全透明的导航栏和状态栏,找到这篇文章https://medium.com/androiddevelopers/gesture-navigation-going-edge-to-edge-812f62e4e83e

但我遇到了一个问题,我无法在导航栏或状态栏旁边显示任何内容 它看起来像这样:enter image description here

代码:

`

<item name="android:enforceNavigationBarContrast">false</item>
<item name="android:enforceStatusBarContrast">false</item>
<item name="android:navigationBarColor">@android:color/transparent</item>
<item name="android:statusBarColor">@android:color/transparent</item>

` java代码:

`

Window w = getWindow();
WindowCompat.setDecorFitsSystemWindows(w, false);

`

问题是什么 ?我不明白 :(

用谷歌搜索并写了一个关于堆栈溢出的问题

【问题讨论】:

    标签: java android xml statusbar navigationbar


    【解决方案1】:

    代码一切正常,检查你是否没有

    android:fitsSystemWindows = true
    

    在你的布局中

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-01-23
      • 2013-09-14
      • 1970-01-01
      • 2015-05-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多