0

I'm using ViewPager to display tabs in Android, but in a circumstance, I want to display a fragment on top of the pager/tabs, but NOT on top of the ActionBar. If I hide the action bar, they both disappear. If I don't do it, I can't find a way to get rid of pager's tab bar (or whatever it's called). Here is a visual representation of what I'm trying to achieve:

enter image description here

How can I hide that bar without hiding the action bar?

Can Poyrazoğlu
  • 33,241
  • 48
  • 191
  • 389

2 Answers2

1

Use this to get rid of tabs in actionbar

setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD)
Fahim
  • 12,198
  • 5
  • 39
  • 57
1

I think you can do it by setting a new navigation mode.

Use setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD) to hide them

Use setNavigationMode(ActionBar.NAVIGATION_MODE_TABS) to show them again

Edit:

Please note that the setNavigationMode methods are deprecated in Android Lollipop. Reference

Community
  • 1
  • 1
arlistan
  • 731
  • 9
  • 20