Search code examples
androidandroid-actionbaractionbarsherlock

ActionBar.NAVIGATION_MODE_STANDARD leaves empty white space at top


I'm using sherlock action bar in my app and in a few fragments I want the tabs gone. By now I'm using ActionBar.NAVIGATION_MODE_STANDARD and it does disappear the tabs but there's an empty white line left at the top of the screen:

enter image description here

I've searched for similiar cases and haven't found exactly the same case. I'm not sure if this question is similiar to mine but I still couldnt figure how to remove that white space.

Here's the actionbar code:

final ActionBar bar = getSupportActionBar();
        bar.setDisplayShowTitleEnabled(false);
        bar.setDisplayShowHomeEnabled(false);
        bar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
        Tab tab1 = bar.newTab()
                  .setText("1")
                  .setTabListener(new TabListener<one>(this, "tab1", one.class));
        bar.addTab(tab1);
        Tab tab2 = bar.newTab()
                .setText("2")
                .setTabListener(new TabListener<two>(this, "tab2", two.class));
         bar.addTab(tab2);

Solution

  • This "empty space" is the ActionBar no ?

    What about the ActionBar.hide() method ?