0

I'm currently using this code to hide the default back indicator and using a custom drawable:

actionBar.setDisplayHomeAsUpEnabled(false);
actionBar.setIcon(R.drawable.icon_actionbar_menu);

The result is that there's a space between the icon and the left up corner. I would like to remove this space and make the icon starting from the left side with no padding \ margin.

Any suggestions ?

andreasperelli
  • 1,034
  • 2
  • 11
  • 40

1 Answers1

1

The answer from the following posts worked for me on phones but not on tablets:

https://stackoverflow.com/a/31314783/2069407

https://stackoverflow.com/a/31865713/2069407

Set the contentInsetStart and contentInsetEnd to 0dp

<style name="MyActionBar" parent="Widget.AppCompat.ActionBar">
    <item name="contentInsetStart">0dp</item>
    <item name="contentInsetEnd">0dp</item>
</style>
Community
  • 1
  • 1
s-hunter
  • 24,172
  • 16
  • 88
  • 130