Changing where cursor starts in an expanded EditText

后端 未结 1 1286
旧巷少年郎
旧巷少年郎 2020-12-16 00:11

I have TextField that is expanded from its normal single line width and height but the cursor to start typing in the EditText is always in the center of the expanded textfie

相关标签:
1条回答
  • 2020-12-16 00:48

    set this in your xml

    android:gravity="top"

    you can also try this

    android:gravity="top | left"

    <EditText
        android:id="@+id/editText1"
        android:gravity="top"   <----------------
        android:layout_width="match_parent"
        android:layout_height="200dp"
        android:layout_alignParentLeft="true"
        android:layout_below="@+id/camera_picture"
        android:layout_marginTop="58dp"
        android:ems="10"
        android:inputType="textMultiLine" >
    
        <requestFocus />
    </EditText>
    
    0 讨论(0)
提交回复
热议问题