I want to change actionbar icon size

To reduce the space between actions icons, in your styles.xml you need to create a actionButtonStyle and referencing it your main theme (ex: “AppTheme”).

1st step (put the two sentences):

<style name="AppTheme" parent="Theme.AppCompat.Light">
  ...
  <item name="android:actionButtonStyle">@style/myActionButtonStyle</item>
  <item name="actionButtonStyle">@style/myActionButtonStyle</item>
  ...
</style>

2nd step (the parameter “android:width” is the great secret):

<style name="myActionButtonStyle" parent="Widget.AppCompat.ActionButton">
    <item name="android:minWidth">30dp</item>
    <item name="android:maxWidth">48dp</item>
    <item name="android:width">38dp</item>
</style>

enjoy it

Leave a Comment