【问题标题】:How to make EditText Can Handles 14 KB text (Kotlin)如何使 EditText 可以处理 14 KB 文本 (Kotlin)
【发布时间】:2021-10-28 00:31:03
【问题描述】:

总之,我有一个应用程序允许您为其他用户上传书籍,以便他们阅读您的书籍,问题是当我添加一个大章节时,它会停在文本中间并且没有'不接受更多。

正如您在这张图片中看到的,它不处理其余的文本。

这里是 EditText 的 XML:

<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" />

这是限制问题还是其他问题?

【问题讨论】:

    标签: android android-studio kotlin android-edittext large-text


    【解决方案1】:

    将整个内容包裹在 ScrollView 中。EditText 受可用空间的限制。 增加可用空间应该可以解决问题。

    【讨论】:

    • 不是android:inputType="textMultiLine" 这样做
    • 是的,但它仍然受到可用空间的限制..因为它是一个非常大的字符串..
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-11-13
    • 2014-11-16
    • 2012-02-22
    • 2014-11-17
    • 2021-01-14
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多