0

I have this code, and it gives me something like this when I type in it.

    <EditText
        android:id="@+id/bottomText"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginBottom="24dp"
        android:ems="10"
        android:gravity="top"
        android:hint="Enter bottom text"
        android:inputType="textMultiLine"
        android:minHeight="150dp"
        android:padding="10dp"
        app:layout_constraintBottom_toTopOf="@+id/button"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent" />

Result

For some rgeason the text does not fill the entire box, and only goes on the left side, the text should fill the whole box. Thanks

John Smith
  • 49
  • 3
  • 1
    android:ems="10" restricts the size of your EditText. Remove it and it should work as expected – TobiWestside Nov 15 '20 at 11:09
  • Your code works fine for me in a ``ConstraintLayout`` - you should probably post the rest of the XML file. ``ems`` is just a width measurement, ``match_parent`` should always override it as far as I know? But if the parent is some other container (where's that blue border coming from?) that could limit the size – cactustictacs Nov 15 '20 at 23:07

1 Answers1

2

You must remove

android:ems="10"

because it prevents the text from extend to it's root layout width learn more about ems.

Ggonstack
  • 31
  • 5