I don't know how this padding came up, but there's no such padding until I updated my SDK to 21. Here's my code:
mActionBar = getSupportActionBar();
mActionBar.setDisplayShowHomeEnabled(false);
mActionBar.setDisplayShowTitleEnabled(false);
actionBarView = LayoutInflater.from(this).inflate(R.layout.title_bar_layout, null);
mActionBar.setCustomView(actionBarView, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
mActionBar.setDisplayShowCustomEnabled(true);
Does anyone know how to solve this ? thanks.
EDIT:
since the last update of Support library
22.1.x
, if you are not usingToolBar
the attributes have to be part of the ActionBar style. E.gand referenced by
<item name="android:actionBarStyle"
OLD ANSWER
to remove the extra padding add
to your style.xml file. And reference it from your app theme with: