How to make EditText Can Handles 14 KB text (Kotlin)

Issue

In summary, I have an app that allows you to upload books for other users so they can read your books, The problem is when I’m adding a large chapter it stops in the middle of the text and doesn’t accept more.

14 KB text

EditText

As you can see in this image it doesn’t handle the rest of the text.

here is XML for the EditText:

<EditText
        android:id"@+id/etChapterBody"
        android:layout_width"match_parent"
        android:layout_height"300dp"
        android:layout_below"@id/tvChapterBody"
        android:layout_marginHorizontal"20dp"
        android:layout_marginVertical"5dp"
        android:autofillHints"no"
        android:background"@drawable/style_stroke"
        android:gravity"clip_horizontal"
        android:hint"@string/body"
        android:inputType"textMultiLine"
        android:paddingHorizontal"7dp"
        android:paddingVertical"5dp"
        android:textColor"@color/dark"
        android:textColorHint"@color/purple_4"
        android:textSize"18sp" />

So is it a limits problem or something else?

Solution

Wrap the whole thing inside a ScrollView.The EditText is constrained by the available space . Increasing the space available should solve the issue.

Answered By – Narendra_Nath

Leave a Comment