Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EditText cursor in top left position. [duplicate]

I am using EditText for message. Height of EditText is 200dp.

Problem is that when i click on this EditText, cursor is blinking on the middle of the EditText,while I want cursor should be blink in the top of the EditText.

like image 703
Rims Sharma Avatar asked Feb 26 '14 04:02

Rims Sharma


1 Answers

set gravity in edittext xml

android:gravity="top"

or in java code:-

editText.setGravity(Gravity.TOP);
like image 87
T_V Avatar answered Oct 05 '22 11:10

T_V