Navigation View item menu background color
drawable/nav_item_background.xml
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@color/blue" android:state_pressed="true"/> <item android:drawable="@color/blue" android:state_focused="true"/> <item android:drawable="@color/blue" android:state_activated="true"/> <item android:drawable="@color/blue" android:state_checked="true"/> <item android:drawable="@color/none"/> </selector>
drawable/nav_item_text.xml
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:color="@color/white" android:state_checked="true"/> <item android:color="@color/white"/> </selector>
drawer.xml :
<?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/menu_live_list" android:icon="@drawable/menu_icon_livelist" android:title="@string/txt_livelist"/> <item android:id="@+id/menu_mylive" android:icon="@drawable/menu_icon_mylive" android:title="@string/txt_mylive"/> </group> </menu>
设置Menu 下面Item 图标及文本颜色
<android.support.design.widget.NavigationView android:id="@+id/navigation" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="left" android:layout_marginBottom="@dimen/toolbar_padding_bottom" android:background="@drawable/login_bac" android:fitsSystemWindows="false" app:itemBackground="@drawable/selector_nav_item_bg" app:itemTextColor="@color/selector_nav_item_text" app:itemIconTint="@color/selector_nav_item_text"/>
相关推荐
Ladyseven 2020-10-22
luofuIT成长记录 2020-09-22
Mynamezhuang 2020-09-18
李鴻耀 2020-08-17
yaodilu 2020-08-03
zhoujiyu 2020-06-28
89510194 2020-06-27
CaiKanXP 2020-06-13
MaureenChen 2020-06-12
Phoebe的学习天地 2020-06-07
淡风wisdon大大 2020-06-06
buttonChan 2020-06-06
xtuhcy 2020-05-20
AlisaClass 2020-05-18
赵家小少爷 2020-05-16
nicepainkiller 2020-05-05