Android Spinner Gravity Doesn't Work

I try for several days to align the text in the spinner on the right, but every time I do not, I tried to set Gravity to the right or with an ellipse, but nothing works, and all I have is:

enter image description here

Can you help with this problem?

Thank you very much.

Here's the XML:

<RelativeLayout android:layout_width="match_parent" android:layout_height="40dp" android:orientation="horizontal" > <org.holoeverywhere.widget.Spinner android:id="@+id/spnCities" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_centerVertical="true" android:layout_marginRight="10dp" android:entries="@array/array_cities" android:gravity="right"/> <TextView android:id="@+id/tvCities" android:layout_width="70dp" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_centerVertical="true" android:layout_marginLeft="10dp" android:text="@string/city" android:textAppearance="?android:attr/textAppearanceSmall" /> 

+6
source share
1 answer

You may have to use a custom view so that this can work. Use google your best friend ... this will probably help:

Align the counter to the right, not left

+1
source

All Articles