Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you make an EditText input from right to left?

I was wondering if you can control input on an EditText to move from right to left? The EditText would have to support insert/delete etc. from right to left as well. Is there a way to do this?

like image 500
ninjasense Avatar asked Feb 22 '11 20:02

ninjasense


People also ask

How do we get the input from the EditText as strings which can be sent to the server?

We have used getText() method to get the text entered in the EditText views. But getText() method returns an Editable instance and therefore we have typecasted it to convert it into String for further use. This can be done by using the toString() method.

How do you make EditText editable?

We can set editable property of EditText in XML layout but not programatically, but there is no setEditable() method! If EditText is not Enabled [ by setEnabled(false) ] it still Editable!


2 Answers

Add this to your editText

        android:textDirection="rtl"
like image 168
M. Usman Khan Avatar answered Oct 11 '22 13:10

M. Usman Khan


It sounds like you just need to set gravity to the right.

like image 43
Rich Avatar answered Oct 11 '22 11:10

Rich