我通过删除android:title中的任何文本来解决这个问题.
NavigationView:
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:headerLayout="@layout/nav_header_main"
app:menu="@menu/activity_main_drawer" />
菜单代码(activity_main_drawer):
xmlns:app="http://schemas.android.com/apk/res-auto">
app:showAsAction="always"
android:title=""
app:actionLayout="@layout/menu_item_layout" />
menu_item_layout:
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:text="Item text" />