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
xml version= "1.0" encoding= "utf-8"? >
< 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>