1

I'm trying to change the size of my overflow menu button. I've changed the actual icon from the default 3 dots to my own settings icon in my drawables. Here's the code:

styles.xml

<resources>

    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
        <item name="android:colorForeground">@color/colorPrimaryDark</item>
        <item name="android:actionOverflowButtonStyle">@style/ToolbarOptions</item>
    </style>

    <!--Toolbar-->
    <style name="ToolbarOptions" parent="Theme.AppCompat.Light.NoActionBar">
        <item name="android:src">@drawable/settings</item>
        <item name="android:contentDescription">settings</item>
        <item name="android:width">9dp</item>
        <item name="android:height">9dp</item>
    </style>

</resources>

and then here's the java:

public class Home extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_home);

        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);

    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.home_menu, menu);
        return true;
    }

}

So how do I change the size of the settings icon? I've changed the width and height in the style tags below but it stays the same.

Zorgan
  • 8,227
  • 23
  • 106
  • 207

0 Answers0