Change color text main menu android?

3

I want to change the text color of a item that groups a menu .

The xml is:

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

    <group android:checkableBehavior="single">
        <item
            android:id="@+id/nav_mi_cuenta"
            android:icon="@mipmap/ic_mi_cuenta"
            android:title="@string/mi_cuenta" />
    </group>

    <item android:title="@string/herramientas">
        <menu>
            <item
                android:id="@+id/nav_configuracion"
                android:icon="@mipmap/ic_config"
                android:title="@string/configuraci_n" />
        </menu>
    </item>

</menu>

I want to change the color of the item:

<item android:title="@string/herramientas">

This is how it is currently:

As you can see, Herramientas comes out in black and as the background is also black as soon as you see it. I do not find any property to change it. The color of item 'My data' and 'Configuration' change it programmatically as follows from a file json external to a server:

colorElegido = getParseColor(json.getString("colorMenuLateral"));
navigationView.setBackgroundColor(colorElegido);

colorElegido = getParseColor(json.getString("colorFuenteMenuLateral"));
ColorStateList colorList = getColorList(colorElegido);

navigationView.setItemTextColor(colorList);
    
asked by 26.06.2017 в 13:54
source

1 answer

2
app:itemTextColor="@color/fondologo"

Example:

<!-- Content Container -->

<android.support.design.widget.BottomNavigationView
    android:id="@+id/bottom_navigation"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    app:itemBackground="@color/colorPrimary"
    app:itemIconTint="@color/white"
    app:itemTextColor="@color/white"
    app:menu="@menu/bottom_navigation_main" />

I hope to arrive in time to help.

It has been hard for me to find it

    
answered by 20.07.2017 в 18:56