I've got a split ActionBar, and I'm trying to add functionality almost identical to google play's 'Now playing'..
I can get menu items to appear at the bottom of the screen, using the onCreateOptionsMenu, but I can't seem to get a custom view to appear at the bottom of the screen when using actionBar.setCustomView. The custom view just sits underneath the top ActionBar.
Does anyone know how to force the customview to the bottom, or to add custom views to the onCreateOptionsMenu?
Here are the snippets of my code:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
ActionBar actionBar = getActionBar();
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
actionBar.setDisplayShowTitleEnabled(true);
actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
//Custom view to add
actionBar.setCustomView(R.layout.albumitem);
//This view shows up just under the top actionbar at the moment,
despite menu items being at the bottom
The menu options code: (These are showing down the bottom where I'd like my custom view to be)
@Override
public boolean onCreateOptionsMenu(Menu menu) {
new MenuInflater(this).inflate(R.menu.option_menu, menu);
return (super.onCreateOptionsMenu(menu));
}
I believe that the now playing menu at the bottom of the google play music app is a custom view inside a split action bar: