Reputation: 1431
How can I change the position of the overflow menu?
This is the menu.xml:
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:id="@+id/action_fill"
android:orderInCategory="101"
android:title="@string/menu_auto_fill"
android:showAsAction="never" />
<item
android:id="@+id/action_delete_all"
android:orderInCategory="102"
android:title="@string/menu_remove_all"
android:showAsAction="never" />
<item
android:id="@+id/action_next"
android:orderInCategory="100"
android:icon="@drawable/ic_action_next_item"
android:title="@string/menu_continue"
android:showAsAction="always" />
</menu>
Currently the menu looks like this:
I need it to look like this:
Upvotes: 0
Views: 650
Reputation: 4957
You cannot change the position of a the designated android overflow menu item, However you could mimic the overflow menu item by placing a similar icon to the left of the rightarrow icon in the action bar and displaying a PopupMenu on its click, which seems to suite your need.
Read more about implementing a PopupMenu here
Upvotes: 2
Reputation: 25194
Just add a submenu:
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:id="@+id/overflow"
android:orderInCategory="100"
android:icon="@drawable/ic_action_overflow"
android:title="@string/overflow"
android:showAsAction="always">
<menu>
<item
android:id="@+id/action_fill"
android:title="@string/menu_auto_fill" />
<item
android:id="@+id/action_delete_all"
android:title="@string/menu_remove_all" />
</menu>
<item
android:id="@+id/action_next"
android:orderInCategory="101"
android:icon="@drawable/ic_action_next_item"
android:title="@string/menu_continue"
android:showAsAction="always" />
</menu>
Note that this requires you to define the overflow item, with his own icon and so on.
Upvotes: 2