简体   繁体   English

支持库 23.2.0 的 NavigationView 奇怪间距

[英]NavigationView weird spacing for support library 23.2.0

I am using Navigation drawer under the App bar for an app.我在应用程序栏下为应用程序使用导航抽屉。 All was working well till support library v23.1.1.在支持库 v23.1.1 之前,一切都运行良好。 Once updated to 23.2.0, the NavigationView shows a weird semi transparent top padding.更新到 23.2.0 后, NavigationView显示一个奇怪的半透明顶部填充。 The behaviour seems related to fitsSystemWindows attribute, and this space is looking like the one designed for the status bar shade.该行为似乎与fitsSystemWindows属性有关,这个空间看起来像是为状态栏阴影设计的空间。

Sample repository here示例存储库在这里

Can anybody help fix this behaviour for support library v23.2.0任何人都可以帮助修复支持库 v23.2.0 的此行为

Nav_view_with_header_23_2_0 Nav_view_with_header_23_1_1 在此处输入图片说明

Remove the attribute android:fitsSystemWindows="true" from you activity.从您的活动中删除属性android:fitsSystemWindows="true" This will remove the space on below the toolbar.这将删除工具栏下方的空间。 As it is said in this blog the fitsSystemWindows attribute sets a padding "to ensure the contents don't overlay the system windows".正如本博客中所说, fitsSystemWindows属性设置了一个填充“以确保内容不会覆盖系统窗口”。

UPDATE: another SO user posted a work-around that seems to address the issue: Android : Fullscreen system visibility screws up window insets更新:另一位 SO 用户发布了一个解决方法,似乎解决了这个问题: Android:全屏系统可见性搞砸了窗口插入


I've been facing the same issue.我一直面临同样的问题。 In my app, we switch the full screen UI flags on and off, depending on the content the user is viewing.在我的应用程序中,我们根据用户正在查看的内容打开和关闭全屏 UI 标志。 Changing the UI flags actually breaks the NavigationView even worse, adding that shaded overlay to the top and bottom of the nav drawer.更改 UI 标志实际上会使 NavigationView 变得更糟,将阴影覆盖添加到导航抽屉的顶部和底部。

I forked your gitHub example and added the ability to change the UI flags.我分叉了您的 gitHub 示例并添加了更改 UI 标志的功能。 You can see my fork here: https://github.com/mnkyby78/SampleDrawer你可以在这里看到我的叉子: https : //github.com/mnkyby78/SampleDrawer

I also opened a ticket on code.google.com: https://code.google.com/p/android/issues/detail?id=231376我还在 code.google.com 上开了一张票: https : //code.google.com/p/android/issues/detail? id = 231376

I haven't found any solutions yet.我还没有找到任何解决方案。 My app is currently stuck using Support Library 23.1.1 until Google fixes this.我的应用程序目前使用支持库 23.1.1 卡住,直到 Google 修复此问题。

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

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