C
C
Chesterfield252021-10-06 23:00:55
XML
Chesterfield25, 2021-10-06 23:00:55

How to change background of BottomNavigationView icon?

How to change background of BottomNavigationView icon?
There is BottomNavigationView

<com.google.android.material.bottomnavigation.BottomNavigationView
        android:id="@+id/bottomBar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/colorDark"
        app:menu="@menu/menu"
        app:itemIconTint="@color/colorOrangeDark"
        android:textColor="@color/colorOrangeDark"
        app:itemTextColor="@color/colorOrange"
        app:layout_constraintHorizontal_bias="0.5"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"/>


Menu itself

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

    <item android:id="@+id/home"
        android:title="@string/home"
        android:icon="@drawable/ic_home"/>

    <item android:id="@+id/shop"
        android:title="@string/shop"
        android:icon="@drawable/ic_shop"/>

    <item android:id="@+id/profile"
        android:title="@string/profile"
        android:icon="@drawable/ic_user"/>


</menu>


Tell me how to change the background of the icon in the active state as in the screenshot?
615e0074b56e0184443085.png

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question