Google 刚刚在他们的博客中发布了 a post讨论实现 Material 设计的最佳实践。它说:
If the app uses a navigation drawer, it follows the newer material design interactions and styling (Figure 7). The drawer appears in front of the app bar. It also appears semitransparent behind the status bar.
但是,如果您查看它在 Google Play Store 和 Inbox by Gmail 等应用中的实现方式,就会发现抽屉导航位于操作栏(工具栏)下方。
但是,Play Newsstand 和 Pushbullet 等应用按照建议使用工具栏上方的抽屉。 那么,我应该使用哪一个?
请注意,如果我应该将抽屉放在工具栏上方,为什么 Google 完全要在汉堡包图标中实现动画 (ActionBarDrawerToggle)?
最佳答案
您应该使用 Material Specs 中的版本,并在栏上显示您的左侧抽屉。
收件箱上 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.
Mobile: Width = screen width - app bar height
Desktop: Max width for the left nav is 400dp. The right nav can vary depending on content.
当你拉出右边的抽屉时,动画也会显示,它应该显示在抽屉的下方。此外,您的抽屉可以是(半)半透明的。
关于android - 抽屉导航图案 Material 设计,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26620007/