I have a toolbar with a LinearLayout inside (I painted the LinearLayout background in black so you can see it better). Inside the LinearLayout I have 3 ImageButtons.
As you can see, in the android studio graphic editor I've selected the first button, and with the selected area we can see that the height is matched with the LinearLayout height and the width is 1/3 of the toolbar width, it's ok!
However, the ImageButton itself (the grey area with the play image) is not matching the selected region, it seems to have some padding, and this is what I want to fix!
I want this (for the three buttons):
Here is my toolbar xml:
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar_bottom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:contentInsetLeft="0dp"
app:contentInsetStart="0dp"
android:elevation="4dp"
android:layout_alignParentBottom="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:weightSum="3"
android:background="@android:color/black"
android:orientation="horizontal">
<ImageButton
android:id="@+id/playButton"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:scaleType="center"
android:clickable="true"
android:src="@drawable/ic_play" />
<ImageButton
android:id="@+id/stopButton"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:scaleType="center"
android:clickable="true"
android:src="@drawable/ic_stop" />
<ImageButton
android:id="@+id/bookmarkButton"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:scaleType="center"
android:clickable="true"
android:src="@drawable/ic_bookmark" />
</LinearLayout>
</android.support.v7.widget.Toolbar>
What I've tried:
Setting android:padding="0dp"
in the LinearLayout
.. But nothing changed.