I'm not sure if this is possible, but try MenuInflater and the menu resource file .
In the menu resource file, try inserting each element into a separate <menu> element, something like this:
<menu> <item> <menu> <item android:id="@+id/item1" android:title="@string/item1" /> </menu> </item> <item> <menu> <item android:id="@+id/item2" android:title="@string/item2" /> </menu> </item> </menu>
Perhaps this will make the inflatable element display objects in 2 separate lines, sorry, I do not have time to check it. If it does not work, replace the submenu with <group> elements and retest.
source share