简体   繁体   English

Android片段中的导航抽屉+滑动选项卡

[英]Navigation Drawer + Sliding Tabs inside fragment Android

I'm trying to get a NavigationDrawer working with sliding tabs inside a fragment (just like google play music or the google i/o app). 我正在尝试使NavigationDrawer在片段内使用滑动选项卡(就像Google Play音乐或Google I / O应用程序一样)。 In all my reasearch I found that you can't use Action bar tabs + Navigation Drawer together because the Navigation drawer will look like in the back of the tabs (I notice that). 在我所有的研究中,我发现您不能同时使用“操作”栏选项卡和“导航抽屉”,因为“导航”抽屉的外观类似于选项卡的背面(我注意到了)。 Can anyone help me telling me how to get that done without use an external library such ActionBarSherlock or TabHost (according to the documentation is recommended the use of actionbar)? 谁能帮助我告诉我如何在不使用诸如ActionBarSherlock或TabHost之类的外部库的情况下完成该工作(根据文档,建议使用Actionbar)?

Yes, you're right. 你是对的。 It won't be possible using ActionBar tabs as the navigation drawer won't overlap them. 无法使用ActionBar标签,因为导航抽屉不会与它们重叠。 I recently implemented a library called ViewPagerAddons which has a custom view called SlidingTabLayoutColors imitating the behavior seen in Google Play/Music. 最近,我实现了一个库调用ViewPagerAddons其中有称为自定义视图SlidingTabLayoutColors模仿在谷歌播放/音乐看到的行为。

But as you said you don't want to use any libraries, you can still have a look at the source code. 但是正如您所说的,您不想使用任何库,您仍然可以查看源代码。 Here's the link with instructions: https://bitbucket.org/enthusiast94/viewpageraddons 这是带有说明的链接: https : //bitbucket.org/enthusiast94/viewpageraddons

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

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