I'm trying for days to align the text in a spinner to right, but every time I fail to do it, I tried to set Gravity to right, or ellipsize to end but nothing works and all I have is this :
can you please help with this issue ?
Thanks a lot.
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" />
You probably have to use a custom view to enable this to work. Use google its your best friend...this will probably help:
Align spinner values to right instead of left
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With