my layout looks like below 
You can see that the spinner has been added to my toolbar, but I want it to align to the right, showing it to the right of the toolbar.
below is the xml code I used
<LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:orientation="vertical" > <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_height="0dp" android:layout_width="match_parent" android:layout_weight="1" android:elevation="4dp" android:gravity="right" //gravity set to right android:background = "@color/color_toolbar" > <Spinner android:id="@+id/spinner_category" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </android.support.v7.widget.Toolbar> </LinearLayout>
spinner does not show android:layout_gravity
I tried to set gravity to the right, but that will not work. How can i do this?
source share