Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android edit text how to start typing at the top left?

I have this EditText

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <EditText
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:inputType="textMultiLine"
        android:lines="5"
        android:singleLine="false"
        android:text="@string/app_name" />

</LinearLayout>

My problem is that typing starts at the middle of the EditText.

My question is how to start typing at the top left of the EditText?

like image 802
Smolina Fezaphitsh Avatar asked Apr 06 '13 13:04

Smolina Fezaphitsh


1 Answers

Try android:gravity="top" so your code will be :

<EditText
     android:layout_width="fill_parent"
     android:layout_height="wrap_content"
     android:gravity="top"
     android:inputType="textMultiLine"
     android:lines="5"
     android:singleLine="false"
     android:text="@string/app_name" />
like image 99
William Kinaan Avatar answered Oct 27 '22 17:10

William Kinaan