The cursors are aligned in the middle of EditText, which is a row of Android, so can't you put them on top?

Asked 2 years ago, Updated 2 years ago, 126 views

<EditText
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:gravity="center"
    android:singleLine="false"
    android:lines="5"
    android:layout_marginLeft="10dip"
    android:layout_marginRight="10dip" />

If you click on this five-line EditText, the cursor is in the third row, and I want it to be in the first row. How shall I do it?

android android-edittext vertical-alignment multiline

2022-09-22 16:08

1 Answers

Give android:gravity="top" to the properties of EditText.


2022-09-22 16:08

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.