1.Menu菜单栏中item字体大小设置:
a、在value/styles.xml中定义样式
b、在使用NavigationView布局中设置使用此样式:
android:id="@+id/nav_view"
android:background="@drawable/background"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:itemTextAppearance="@style/WindowTitle"
app:headerLayout="@layout/nav_header_main2"
app:menu="@menu/activity_main_drawer"/>
2.Menu菜单栏中item字体颜色设置:
Resources resource=(Resources)getBaseContext().getResources();
ColorStateList csl=(ColorStateList)resource.getColorStateList(R.color.mywhite);
navigationView.setItemTextColor(csl);
3.设置MenuItem默认选中项
navigationView.getMenu().getItem(0).setChecked(true);