Android: problems with splitActionBarWhenNarrow

I am trying to use the ui: splitActionBarWhenNarrow option in my application, but it seems that I am experiencing unwanted behavior.

EDIT: Attaching a small gist with some more code.

This is the code in the manifest for the activity:

<activity
        android:name="com.example.HomeActivity"
        android:uiOptions="splitActionBarWhenNarrow"
        android:label="@string/app_name" >

      

This is the only action that I intend to change in the ActionBar style. In the action code, I have disabled the title and actionBar so that the tabs can be merged as the only top action bar.

    private void setupActionBar() {
    final ActionBar mActionBar = getActionBar();

    mActionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
    mActionBar.setDisplayShowHomeEnabled(false);
    mActionBar.setDisplayShowTitleEnabled(false);

    mActionBar.addTab(mActionBar.newTab().setIcon(R.drawable.tab_one).setTabListener(this));
    mActionBar.addTab(mActionBar.newTab().setIcon(R.drawable.tab_two).setTabListener(this));
    mActionBar.addTab(mActionBar.newTab().setIcon(R.drawable.tab_three).setTabListener(this));
    }   

      

It worked well; however, it appears that the bottom action bar doesn't fit to the bottom of the action, but just below the top action bar.

This is what it looks like after the code I wrote: “How can I get it to go all the way, like in the Android instant messaging app for Android?

Modify, re-link images.

This is how it looks at the moment using the code above, and here is how I want it to look.

+3


source to share


1 answer


I posted a working demo app with tabs and actiobar on buttom
Here



Check it out and hope it helps

0


source







All Articles