androidandroid-imagebutton

Icons on button


I have ImageButton with Android icon:

            <ImageButton
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:contentDescription="Icon"
                android:src="@drawable/ic_android"
                />

How to change this icon to "confirm". I would like to use icon from standard Android library. How to do that? What logic I should go find required icon in standard Android library?


Solution

  • Android Studio already has bunch of commonly used icons. Steps to get the icon :

    1. Right-click on drawable folder
    2. Select new and the select vector asset
    3. Click on clipart and search for the required icon
    4. Choose your icon and set name and color
    5. Finish

    Step 1 : Step 1

    Step 2 : Step 2

    Step 3 : Step 3

    Step 4 : enter image description here