About the problem that the itemIconTint selection color of the navigation bar at the bottom of BottomNavigationView has not changed?

problem description

when using BottomNavigationView as the bottom navigation bar, you want to achieve a different color state between selected and unchecked, but do not achieve the desired effect. Click on other sub-items, and the color does not change, so you want to know what the reason is (the first question is a little nervous). Thank you

effect

only the first state selected by default will change the color

related codes

/ / created color resource style.xml code snippet

< selector xmlns:android= " http://schemas.android.com/ap...;>

<item android:color="@android:color/holo_blue_light"
    android:state_checked="true" />
<item android:color="@android:color/black"
    android:state_checked="false"/>

< / selector >

/ / BottomNavigationView code side

   android:id="@+id/navigationview"
    android:layout_width="match_parent"
    android:layout_height="50dp"
    android:background="-sharpfff"
    app:itemIconTint="@color/select"
    android:layout_alignParentBottom="true"
    app:menu="@menu/style">
</android.support.design.widget.BottomNavigationView>
Jun.06,2022

to change color when I use it, I put select into the menu file, like this:


    <item android:state_checked="true" android:drawable="@drawable/svg_tab_bar_find_hl"/>
    <item android:drawable="@drawable/svg_tab_bar_find"/>
</selector>
Menu