sherry sherry - 5 months ago 36
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?


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