Positioning menu items on a toolbar across two panes

I am developing a tablet version of an application and have a 2 pane layout (master) with 2 fragments, where the left fragment contains one menu item and the right fragment contains several menu items. By default, all menu items for both fragments are displayed at the right end of the toolbar.

How can I position the left fragment menu item directly above the upper right corner of that fragment (see gmail app on tablets in landscape mode as an example -> gmail tablet )?

+3


source to share


1 answer


It depends on the relative orderInCategory values under each menu item, even for items in different menu files when rendered in two modes.

This will be shown below

<item android:id="@+id/action_sort_popular"
    android:title="@string/sort_popularity"
    android:orderInCategory="101"
    app:showAsAction="never" />

      



And this will be shown above

<item android:id="@+id/action_sort_rating"
    android:title="@string/sort_rating"
    android:orderInCategory="100"
    app:showAsAction="never" />

      

0


source







All Articles