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
Asked
Active
Viewed 7,268 times
6
-
Check out this answer: http://stackoverflow.com/a/6302325/1337412 – theelfismike Oct 06 '12 at 21:29
-
adding the unicode LTR mark does seem to have an effect. – Aviran Oct 07 '12 at 05:52
4 Answers
5
use gravity for the editText
android:gravity="right"

JafarKhQ
- 8,676
- 3
- 35
- 45
-
1I think OP means LTR as in Arabic language, not as aligned to the right. – Vincent Mimoun-Prat Oct 06 '12 at 20:49
-
but when you aligned the arabic text to right its will appear correctly. im an arabic developer – JafarKhQ Oct 06 '12 at 20:57
-
1aligning to the right would work if I wanted RTL text. what I need is LTR directional text. a text that's aligned to the left and in case the chars "aa bb" are inserted the Edit text the text should display "aa bb" and not "bb aa" which is the case when using an RTL language (Hebrew in my case). – Aviran Oct 07 '12 at 05:39
0
Add these to your EditText
:
android:gravity="left"
android:textDirection="ltr"
Note: android:textDirection
requires API level 17

Satan Pandeya
- 3,747
- 4
- 27
- 53

Kaaveh Mohamedi
- 1,399
- 1
- 15
- 36