sherry sherry - 1 year ago 117
Android Question

How to right-align text in an Android TextView or EditText?

I have an EditText in my application. I want to align the text in it to the right instead of the default left. I tried adding


but this doesn't seem to work. any other suggestions please?

Answer Source

You should use android:gravity="right". layout_gravity is for the view (EditText) alignment against the container.

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