This question already has an answer here:
Android support design library provide NavigationView:
<android.support.design.widget.NavigationView
...
app:menu="@menu/navigation_drawer_items" />
menu/navigation_drawer_items:
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<group android:checkableBehavior="single">
<item .../>
...
</group>
<group android:checkableBehavior="single">
<item .../>
...
</group>
</menu>
How to add divider, separator or space between groups (like on picture)?
You can add your text between
<item android:title="title_name">
and</item>
I'm using it this way:
IDs are important (+id/group1 and +id/group2). Without ids you won't see divider. It is working in my app.
Divider in NavigationMenuList achieved using grouping the Menu items but make sure you are giving group id @+id that is necessary. Below is working code for you
Just give a unique id to each group. It will create a separator automatically.
you do something like this.
this code is taken from the Design Library example app made by Chris Barnes https://github.com/chrisbanes/cheesesquare