Aviran
Aviran

Reputation: 5468

android EditText android:textDirection

I'd like to set an EditText to be LTR at all times, how do I do that? android:textDirection does seem to be the answer, i cant get the project to compile with that directive

Upvotes: 7

Views: 7506

Answers (4)

Kaaveh Mohamedi
Kaaveh Mohamedi

Reputation: 1805

Add these to your EditText:

android:gravity="left"
android:textDirection="ltr"

Note: android:textDirection requires API level 17

Upvotes: 0

user3033689
user3033689

Reputation: 1

use direction for the editText

android:textDirection="ltr"

Upvotes: 0

Aviran
Aviran

Reputation: 5468

Adding \u202D (LTR OVERRIDE) to the beginning of the string does the trick

Upvotes: 1

JafarKhQ
JafarKhQ

Reputation: 8734

use gravity for the editText

android:gravity="right"

Upvotes: 5

Related Questions