Android spinner text aligns right

I have a counter that contains 3 elements: "English", "Simplified Chinese", "Traditional Chinese".
If I select English, the picture below will be shown below. enter image description here
I mean after selecting and displaying the selected, but not all list items, as shown below:
enter image description here
My layout.xml as below:

<RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent" > <Spinner android:id="@+id/spinner1" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_alignParentRight="true" android:layout_centerVertical="true" android:background="@drawable/spinner_selector" android:gravity="right" /> </RelativeLayout> 

I want the text to align to the right.
But the width appears as the longest element.
And the text is aligned to the left.
How can I change it?

+4
source share

Source: https://habr.com/ru/post/1493401/


All Articles