2014-10-24 11 views
13

Voglio allineare un elemento a sinistra del ActionBar e gli altri a destra in questo modo:Allineare una voce a sinistra di ActionBar

enter image description here

Ho 5 oggetti nel mio menù xml.

main.xml

<menu xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:tools="http://schemas.android.com/tools" 
tools:context="fr.mgs.consulting.allbrary_android.MainActivity" > 

<item 
    android:id="@+id/action_spinner" 
    android:showAsAction="always" 
    android:actionLayout="@layout/spinner_actionbar" 
    android:title="@string/action_spinner" 

    android:orderInCategory="1"/> 

<item 
    android:id="@+id/action_search" 
    android:showAsAction="always" 
    android:title="@string/action_spinner" 
    android:icon="@drawable/ic_action_search" 
    android:orderInCategory="2"/> 

<item 
    android:id="@+id/action_tablet" 
    android:showAsAction="never" 
    android:title="@string/action_spinner" 
    android:icon="@drawable/ic_action_tablet" 
    android:orderInCategory="3"/> 

<item 
    android:id="@+id/action_notifications" 
    android:showAsAction="always" 
    android:title="@string/action_spinner" 
    android:icon="@drawable/ic_action_notifications" 
    android:orderInCategory="4"/> 

<item 
    android:id="@+id/action_user" 
    android:showAsAction="always" 
    android:title="@string/action_spinner" 
    android:icon="@drawable/ic_action_user" 
    android:orderInCategory="5"/> 

Come possiamo farlo? Ci scusiamo per il mio pessimo inglese.

+0

avere fortuna con questo? – ihsan

risposta