简体   繁体   English

导航抽屉图案材料设计

[英]Navigation Drawer pattern material design

Google just posted in their blog a post discussing best practices for implementing the material design. 谷歌刚刚在他们的博客中发布了一篇文章,讨论了实施材料设计的最佳实践。 It says: 它说:

If the app uses a navigation drawer, it follows the newer material design interactions and styling (Figure 7). 如果应用程序使用导航抽屉,则会遵循较新的材质设计交互和样式(图7)。 The drawer appears in front of the app bar. 抽屉出现在应用栏前面。 It also appears semitransparent behind the status bar. 状态栏后面也显示半透明。

But, if you look at how it is implemented in apps like Google Play Store and Inbox by Gmail, the navigation drawer is located below the Action Bar (Toolbar). 但是,如果您查看它是如何在Google Play商店和Inbox by Gmail等应用中实施的,则导航抽屉位于操作栏(工具栏)下方。

在此输入图像描述

However, apps like Play Newsstand and Pushbullet use their drawer above the toolbar, as recommended. 但是,根据建议,Play Newsstand和Pushbullet等应用程序会在工具栏上方使用抽屉。 So, which one should I use? 那么,我应该使用哪一个?

One side note, if I should place the drawer above the toolbar, why did Google implement the animation in the hamburger icon at all(ActionBarDrawerToggle)? 一方面注意,如果我将抽屉放在工具栏上方,为什么Google会在汉堡包图标中实现动画(ActionBarDrawerToggle)?

You should use the version from the Material Specs and display your left drawer over the bar. 您应该使用材料规格中的版本并在条形图上显示左侧抽屉。

The width of the NavigationDrawer on Inbox is also incorrect: 收件箱中NavigationDrawer宽度也不正确:

The width of the side nav is equal to the width of the screen minus the height of the action bar, or in this case 56dp from the right edge of the screen. 侧导航的宽度等于屏幕宽度减去操作栏的高度,或者在这种情况下,距离屏幕右边缘56dp。

Mobile: Width = screen width - app bar height 移动:宽度=屏幕宽度 - 应用栏高度

Desktop: Max width for the left nav is 400dp. 桌面:左侧导航的最大宽度为400dp。 The right nav can vary depending on content. 右侧导航可能因内容而异。

The animation also shows when you pull out the right drawer, which should be displayed below the drawer. 当您拉出右侧抽屉时,动画也会显示,抽屉应显示在抽屉下方。 Further more, your drawer can be (semi-)translucent. 此外,您的抽屉可以是(半)半透明的。

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

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