Home Ask Login Register

Developers Planet

Your answer is one click away!

mdehghani February 2016

How to remove padding from action bar logo?

I've managed to set a logo for action bar using these lines of code:

getSupportActionBar().setDisplayShowTitleEnabled(false); //optional

but there is always some sort of padding at the right of the logo. Is there a way to eliminate it?



Pztar February 2016

Use setContentInsetsAbsolute(int leftInset, int rightInset) on your toolbar

The values are in dp by default it's set at 16dp

Helix February 2016

My typical solution when I want to go above and beyond what the ActionBar is designed for is to hide the ActionBar completely using


and instead implement a relative layout within the activity's layout file that follows the guidelines of an ActionBar as outlined by google HERE

This provides the flexibility to alter the appearance to whatever degree you'd like while maintaining the graphical appearance of Material Design.

Post Status

Asked in February 2016
Viewed 2,421 times
Voted 8
Answered 2 times


Leave an answer

Quote of the day: live life