0

A client wants a big logo on the actionbar instead of an icon and I didn't found a way to set the padding to 0dp to stretch it to the height of the action bar. So I went for a custom view to display the logo, this looks good in potrait, but in landscape the custom view positioned after the tabs. I tried the solutions I found here, but with no result. Is there a way to postion the custom view before the tabs?

The code:

    // Set up the action bar.
    final ActionBar actionBar = getActionBar();
    actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM | ActionBar.DISPLAY_SHOW_HOME);
    //actionBar.setDisplayShowHomeEnabled(true);
    //actionBar.setDisplayShowCustomEnabled(true);
    actionBar.setDisplayShowTitleEnabled(false);
    actionBar.setCustomView(R.layout.custom_actionbar);
    actionBar.setLogo(null);
    View homeIcon = findViewById(android.R.id.home);
    ((View) homeIcon.getParent()).setVisibility(View.GONE);
    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);

Edit: After more research I'll dump the action bar, there is no way to do this.

TonT
  • 36
  • 4
  • Which solutions have you tried - can you explain or link them? – aland Jul 19 '14 at 22:41
  • [link](http://stackoverflow.com/questions/8136754/how-to-align-the-actionbar-tabs-to-the-right) and [link](http://stackoverflow.com/questions/9652075/how-to-customize-android-actionbar-to-show-a-custom-view-before-the-tabs) – TonT Jul 20 '14 at 01:00

0 Answers0