I need an EditText with vertical and horizontal scrolling and a fixed size, I used ScrollView and HorizontalScrollView but the EditText does not fill the View above, leaving just a small square that only fills when the text is added.
<ScrollView
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent">
<HorizontalScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<EditText
android:id="@+id/edit_text"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="start"
android:scrollbars="vertical|horizontal"
android:inputType="textMultiLine"
android:padding="10dp"
android:background="@color/purple_700"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
</HorizontalScrollView>
</ScrollView>
I’ve already tried changing the layout_width and layout_height to fixed and EditText’s behavior remains the same.
New contributor
Anderson Miranda is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.