Reputation: 646
I have EditText which takes up the entire screen. And cursor is always in the middle of EditText, but I need it to be at the top of EditText. What am I supposed to do? My layout:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<EditText
android:id="@+id/noteEditText"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:background="@null"
android:inputType="textLongMessage|textCapSentences|textImeMultiLine|textMultiLine" />
</RelativeLayout>
Upvotes: 1
Views: 64
Reputation: 785
Try adding android:gravity="start|top"
& android:textAlignment="viewStart"
Here' the full code
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<EditText
android:id="@+id/noteEditText"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:background="@null"
android:gravity="start|top"
android:inputType="textLongMessage|textCapSentences|textImeMultiLine|textMultiLine"
android:textAlignment="viewStart" />
</RelativeLayout>
Hope this helps. Feel free to ask for clarifications
Upvotes: 2