I am using the new navigation drawer available from the support library. When using the drawer along with tabs, the drawer menu is getting displayed below the tabs as shown below. How can i make sure the drawer menu is shown on the tabs. (It should display the drawer menu as if there are no tabs)
Drawer menu without tabs
Drawer menu with tabs
You can hide View responsible for rendering tabs manualy:
Just call this method from your implementation of
ActionBarDrawerToggle
like this:This solution will work just fine, if you are using ActionBar.Tabs on narrow screen (Tabs are shown automatically BELOW ActionBar). But if you want to handle all other navigation scenarios (NavigationMode: List, CustomNavigationView, or Tabs are showing directly in ActionBar), the first method needs to handle all these possibilities:
Here is the solution I am using looks like(works perfectly): I am using frame layout to be able swap fragments and the tabbed layout is the tabs on the base fragment.
activity_main.xml
I am not sure about Action Bar tabs , but you can use Pager Tab Strip in combination of Navigation Drawer to get navigation model similar like Google Play Music , have a look at my post
Actionbar Navigaton Drawer and SwipeTabs cant be used simultaneously. You should implement Navigation Drawer using Actionbar and swipetabs by simple Tabhosts. You can use Tabhost for tabs and use fragments for inside view of each Tab. Fragments should be used via viewpager to provide scrolling/swiping effect. Connect tabs and viewpager with eachother through their methods
Create a separate fragment say TabsFragment and add the fragment inside the fragment container in your main activity.
The tabs can be added inside the tabs fragment with the following code.
Here, TabA and TabB are separate fragments for the tabs. You can implement your functionality of the respective tabs in respective fragments. Reference : http://developer.android.com/reference/android/support/v4/app/FragmentTabHost.html
I believe it's too late since question was asked but still. If you are already using navigation drawer and want navigation tabs, include the two files in your project folder:
1) SlidingTabLayout.java http://developer.android.com/samples/SlidingTabsBasic/src/com.example.android.common/view/SlidingTabLayout.html
2) SlidingTabStrip.java http://developer.android.com/samples/SlidingTabsBasic/src/com.example.android.common/view/SlidingTabStrip.html
In the navigation drawer fragment, include the following:
Hope it helps!!