让 DrawerLayout 在 ActionBar 上滑动 [英] Getting DrawerLayout to Slide over the ActionBar
问题描述
我在一个活动中有一个滑动抽屉菜单,它有一个带有一些选项卡的操作栏.
I have a sliding drawer menu in an activity, which has an actionbar with some tabs on it.
我想让滑动抽屉滑过标签,而不是在它们下面.
I'd like to get the sliding drawer to slide over the tabs , not below them.
这就是现在的样子...
This is what it looks like right now...
关于如何做到这一点的任何想法?
Any ideas on how this could be done?
注意:我知道我在这里可能会违反一些约定和 UI 模式,如果它根本不起作用,我会考虑替代方案.但我想先让这个工作.
Note: I understand that I might be breaking some conventions and UI patterns here, and if it does not work at all, I'll look at alternatives. But I'd like to get this working first.
请参阅以下 Google Play 音乐应用的屏幕截图,它完全满足我的需求.请参阅下面的@CommonsWare 的回答,他确实同意我可能会违反惯例.但考虑到 Play Music 应用程序,它也可能并不那么罕见.
See the below screen shot of the Google Play Music app that does exactly what I need. See @CommonsWare's answer below where he does agree that I might be breaking convention. But then given the Play Music app, it may not be altogether that rare either.
推荐答案
关于如何做到这一点的任何想法?
Any ideas on how this could be done?
执行以下任一操作:
从操作栏选项卡切换到
ViewPager
和选项卡式指示器(PagerTabStrip
,TabPageIndicator
来自 ViewPageIndicator)
Switch away from action bar tabs, perhaps to
ViewPager
and a tabbed indicator (PagerTabStrip
,TabPageIndicator
from ViewPageIndicator)
查看现有的第三方抽屉实现是否尚未更新为新的 UI 标准
See if an existing third-party drawer implementation has not yet updated to the new UI standards
fork DrawerLayout
并修改它以适应
Fork DrawerLayout
and modify it to suit
从头开始滚动你自己的导航抽屉
Roll your own navigation drawer from scratch
我知道我可能会在这里打破一些约定和 UI 模式
I understand that I might be breaking some conventions and UI patterns here
正确.
这篇关于让 DrawerLayout 在 ActionBar 上滑动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!