NavigationView 是谷歌更新5.0以後帶來的新控件,目的是統一側邊菜單。android
項目中使用,添加了一個Menu文件,由於總體文字偏小,修改了主題後發現只有側邊菜單的字體沒有變化app
<android.support.design.widget.NavigationView xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/navigation_menu" android:layout_width="250dp" android:layout_height="match_parent" android:layout_gravity="left" android:fitsSystemWindows="true" app:headerLayout="@null" android:paddingLeft="8dp" android:paddingRight="8dp" android:background="@mipmap/left_menu_background" app:menu="@menu/menu_drawer" />
改正方法在項目使用的主題中 新建 MenuTextStyle樣式字體
<style name="MenuTextStyle"> <item name="android:textColor">@android:color/white</item> <item name="android:textSize">22sp</item> </style>
而後在NavigationView 下增長引用 成功解決code
app:theme="@style/MenuTextStyle"