0
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity"
    android:id="@+id/fragment_container">

   <com.ismaeldivita.chipnavigation.ChipNavigationBar
       android:layout_width="match_parent"
       android:layout_height="wrap_content"
       android:padding="10dp"
       android:id="@+id/bottom_nav_menu"
       app:cnb_textColor ="@color/white"
       app:cnb_unselectedColor="@color/black"`enter code here`
       android:layout_marginBottom="5dp"
       app:cnb_menuResource="@menu/bottom_navigation_menu_chef"
       android:layout_alignParentBottom="true"
       />
</RelativeLayout>

How I can set the text color of the selected item using this library on any other way?

Aniruddh Parihar
  • 3,072
  • 3
  • 21
  • 39

2 Answers2

0

In menu item add app:cnb_textColor="@color/home_label"

Usama Altaf
  • 90
  • 1
  • 4
  • 23
0

As i see.. You can set the selected color changing the cnb_textColor in the bottom_navigation_menu_chef.

I will get you an example:

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

    <item
        android:id="@+id/home"
        android:icon="@drawable/ic_home"
        android:title="Home"
        app:cnb_textColor="@android:color/holo_red_dark"/>

    <item
        android:id="@+id/activity"
        android:icon="@drawable/ic_activity"
        android:title="Activity"
        app:cnb_textColor="@android:color/holo_green_dark"/>

    <item
        android:id="@+id/favorites"
        android:icon="@drawable/ic_heart"
        android:title="Favorites"
        app:cnb_textColor="@android:color/black"/>

    <item
        android:id="@+id/settings"
        android:icon="@drawable/ic_settings"
        android:title="Settings"
        app:cnb_textColor="@android:color/holo_blue_light" />

</menu>