1

I want to create mutliple action bars (two) on the same activity for my Android App.

Here are my explanations:

I want a "header action bar" and a "footer action bar" to separate my menus :

  • one for options "Refresh" and "Settings"
  • and one for user actions "Send a post" and "Help".

Currently, I use this method:

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.main_header, menu);

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
        ActionBar actionBar = getActionBar();
        actionBar.setDisplayHomeAsUpEnabled(true);
    }
    return true;
}

My question is: how can I add another action bar and put it into the footer? It is possible?

(Example: http://i.stack.imgur.com/7sfh6.png)

Left image, action bar at the top (doesn't take into account the tab navigation) and the split Action Bar at the bottom.

I don't know what to say more, so if you want more informations you are free to ask me any questions.

4

1 に答える 1

1

マニフェスト ファイルの uiOptions="splitActionBarWhenNarrow" オプションをご覧ください: http://developer.android.com/guide/topics/manifest/application-element.html

注: これは Android 5.0 で廃止されました: https://code.google.com/p/android/issues/detail?id=79722

于 2013-08-02T18:59:53.750 に答える