0

enter image description here

The ActionBar shows a space on the left side of the custom view. I want to set my custom view align left of Actionbar.

I'm trying to set

    getSupportActionBar().setDisplayShowTitleEnabled(false);
    getSupportActionBar().setDisplayShowHomeEnabled(false);

and any other method like setLogo(null),But it's not work.

My code is like

    ABCMainView actionLayout = new ABCMainView(this); //my custom view
    getSupportActionBar().setDisplayShowCustomEnabled(true);
    getSupportActionBar().setDisplayShowTitleEnabled(false);
    getSupportActionBar().setDisplayShowHomeEnabled(false);
    getSupportActionBar().setCustomView(actionLayout);

My ActionBar is android-appcompat-v21.

How can i do this?

Ray
  • 468
  • 4
  • 17

1 Answers1

0

Try with this in your Toolbar xml config

android:contentInsetStart="0dp"

Base on Chris Banes' response https://stackoverflow.com/a/26495926/1568429

Community
  • 1
  • 1
Antonio Jose
  • 2,778
  • 3
  • 21
  • 26