0

By default in every activity only home icon is getting highlighted.

  1. How to change the highlight the icon which is selected ?
  2. How to change the default highlighting icon ?
  3. Where to make the changes in which activity_main.xml or MainActivity.java or else menu xml file ?

Login icon is pressed but home is getting highlighted : selector.xml

MainActivity.java

activity_main.xml

nav_items.xml-menu item I pressed the second icon,activity is changed but still home is getting highlighted in emulator

1 Answers1

1

Try this

Add a selector.xml in drawable folder like

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/beyaz" android:state_enabled="true" />
<item android:color="@color/colorPrimaryDark" android:state_enabled="false" />
</selector>

In activity_main.xml add app:itemIconTint="@drawable/selector"

 <android.support.design.widget.BottomNavigationView

    app:itemIconTint="@drawable/selector"

    />
Sreejesh K Nair
  • 563
  • 1
  • 6
  • 16