I'm trying to add a divider to my toolbar option menu, and i can't make it to work. How can I add a divider as shown in the image below:
Thanks.
I'm trying to add a divider to my toolbar option menu, and i can't make it to work. How can I add a divider as shown in the image below:
Thanks.
For Android 6.0 Google remove dividers.
Material Themes doesn't display it.
can you try this code :
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context=".MainActivity">
<group android:id="@+id/grpSort" android:checkableBehavior="single" >
<item
android:id="@+id/action_sort"
android:checked="true"
android:icon="@drawable/ic_sort"
android:title="@string/sort" />
</group>
<group android:id="@+id/grpHelp" android:checkableBehavior="single" >
<item
android:id="@+id/action_Help"
android:icon="@drawable/ic_help"
android:title="@string/help" />
</group>
It's important to add a unique id to each <group>
.