0

I have implemented tab host with navigation drawer using ActionBarShaerlock. Currently element to open navigation drawer on action bar and tab host in bottom of it.

Screenshot

I want tabs in actionbar. It it possible to do so?

Community
  • 1
  • 1
Deep Rathod
  • 69
  • 3
  • 14
  • http://developer.android.com/guide/topics/ui/actionbar.html.check Adding Navigation tabs. You have the drawer so why do you need tabs. http://stackoverflow.com/questions/16713530/android-navigation-drawer-over-the-tabs – Raghunandan Feb 11 '14 at 05:28
  • are you looking for tabs just below action bar? – Neha Nathani Feb 11 '14 at 05:30
  • I have already implemented as shown in the scrrenshot using actionbarsherlock , however i am looking for implementing DrawerMenu and Tabhost on actionbar(On single Line). – Deep Rathod Feb 11 '14 at 05:32

1 Answers1

0

you can add tabs below action bar using something like this-

  ActionBar actionBar = getSupportActionBar();
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
actionBar.setDisplayShowTitleEnabled(false);

Tab tab = actionBar.newTab()
                   .setText(R.string.artist)
                   .setTabListener(new TabListener<ArtistFragment>(
                           this, "artist", ArtistFragment.class));
actionBar.addTab(tab);

tab = actionBar.newTab()
               .setText(R.string.album)
               .setTabListener(new TabListener<AlbumFragment>(
                       this, "album", AlbumFragment.class));
actionBar.addTab(tab);

see this link here

hope this will help you.

Ravi Bhandari
  • 4,682
  • 8
  • 40
  • 68