BottomNavigationBar-change the tab icon color
Change to app:itemIconTint="@drawable/selector"
Also change your selector.xml
to this:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true" android:color="@color/beyaz" />
<item android:color="@color/colorPrimaryDark" />
</selector>
I was confused about whole process despite reading all the answers, so here is how I resolved it step by step so beginners can understand it properly
Let's say you created MainActivity
with bottom navigation so
in your drawable
folder create bottom_navigation_selector.xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true" android:color="@color/yourSelectedColor" />
<item android:color="@color/defaultColor" />
</selector>
then go to the activity_main.xml
layout and add this line in BottomNavigationView
app:itemIconTint="@drawable/bottom_navigation_selector"
If you also want to change text color accordingly then you need to add this line aswell
app:itemTextColor="@drawable/bottom_navigation_selector"