Mahmoud Al-Haroon
Mahmoud Al-Haroon

Reputation: 2449

How to change the size of android item icon menu in the toolbar?

I want to change the width and height of the below image icon in tool bar:

Icon Toolbar

and this is the related app\src\main\res\menu\main.xml

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">

    <item
        android:id="@+id/action_favorite"
        android:orderInCategory="300"
        android:title="User"
        android:icon="@drawable/filterr"
        app:showAsAction="ifRoom"></item>
</menu>

Upvotes: 0

Views: 284

Answers (1)

IntelliJ Amiya
IntelliJ Amiya

Reputation: 75778

You can try with VectorDrawable. Vector images do not lose quality when they are scaled. A vector image can be scaled indefinitely.

<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:height="24dp"
    android:width="24dp"

android:height - Used to define the intrinsic height the drawable.

android:width - Used to define the intrinsic width of the drawable.

Upvotes: 1

Related Questions