The new Navigation View provided in the support library for using the material design, int changing the xml parameters: - android.support.design:itemIconTint - android.support.design:itemTextColor I've found in the Class reference that this parameters can change through java coding but i want to do it in the xml file, nevertheless it dosnt work i dont know what im doing wrong.
Here is My Navigation Drawer and Navigation View XML
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:android.support.design="http://schemas.android.com/tools"
android:fitsSystemWindows="true">
<RelativeLayout
--- content
</RelativeLayout>
<android.support.design.widget.NavigationView
android:layout_width="280dp"
android:layout_height="match_parent"
android:id="@+id/navigationView"
android:layout_gravity="start"
android.support.design:itemIconTint="@color/navigation_view_color_set"
android.support.design:itemTextColor="@color/navigation_view_color_set"
app:headerLayout="@layout/navigation_view_header"
app:menu="@menu/menu_data"/>
And my ColorStateList in a subdirectory of .res, named color.
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true" android:color="@color/primary"/>
<item android:state_pressed="true" android:state_enabled="false" android:color="@color/primary_dark" />
<item android:state_enabled="false" android:color="@color/primary_dark" />
<item android:color="@android:color/white"/>
</selector>
I don`t know whats going wrong, and i cant find any documentation using this xml parameters.
what I what to accomplish.
http://www.google.com/design/spec/patterns/navigation-drawer.html#navigation-drawer-content
You may have to try this instead of android.support.design:itemIconTint
app:itemIconTint="@color/navigation_view_color_set"
app:itemTextColor="@color/navigation_view_color_set"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With