【问题标题】:Showing content behind Navigation Bar在导航栏后面显示内容
【发布时间】:2016-08-09 23:29:40
【问题描述】:

我目前正在做一些事情,我希望状态和导航栏是透明的,内容在它们后面。目前,我在 styles.xml 中将栏设置为 @android:color/transparent,并且能够使用以下代码获取状态栏后面的内容:

getWindow().getDecorView().setSystemUiVisibility(
            View.SYSTEM_UI_FLAG_LAYOUT_STABLE |
                   View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
            );

但是,我仍在努力将其放在导航栏后面。任何帮助表示赞赏。

谢谢, 乔什

【问题讨论】:

    标签: android


    【解决方案1】:

    你需要:

    getWindow()
      .setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
    

    在这里查看答案:

    Showing content behind status and navigation bar

    【讨论】:

      【解决方案2】:

      尝试将这些添加到您的活动的style.xml

      <item name="android:windowTranslucentStatus">true</item>
      <item name="android:windowTranslucentNavigation">true</item>
      <item name="android:fitsSystemWindows">true</item>
      

      希望这能有所帮助。

      【讨论】:

        猜你喜欢
        • 2018-01-13
        • 1970-01-01
        • 2016-06-11
        • 1970-01-01
        • 1970-01-01
        • 2020-09-08
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多