Is there anyway to make an EditText start typing at the top left corner of the EditText?

I have an EditText with the property:

android:minLines="3"

However, when I start typing, it types in the middle of the EditText.

Is there any way to get this to start typing at the top left of the EditText area?

Answers


Add android:gravity="top|left" to the EditText in the layout XML file.


Just insert

android:gravity="top"

into your EditText.


android:gravity="start" would put it to the top left.


This will help you. Try this EditText....

<EditText
    android:id="@+id/edt_comment_note"
    android:layout_width="fill_parent"
    android:layout_height="60dp"
    android:background="@drawable/white_box"
    android:gravity="top"
    android:hint="Note"
    android:imeOptions="actionDone"
    android:maxLines="3"
    android:padding="5dp"
    android:textSize="15sp" />

Need Your Help

How to set the max size of upload file

tomcat file-upload spring-boot jhipster

I'm developing application based on Spring Boot and AngularJS using JHipster.

Convert Datetime column from UTC to local time in select statement

sql sql-server

I'm doing a few SQL select queries and would like to convert my UTC datetime column into local time to be displayed as local time in my query results. Note, I am NOT looking to do this conversion via