David David - 1 year ago 94
Android Question

Align spinner values to right instead of left

In spinner xml, I'm using:


where cars is list of numeric items.

The spinner automatically align values to left, and I can't find in xml/code how to change it.

Answer Source

You have to use a custom view here to give alignment to the Spinner values. Create a CustomView like this answer has created and add android:gravity to the TextView as right.


Set the CustomView to your adapter using

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download