当键盘显示时,EditText 的内置滚动不会滚动到最后 - 键盘隐藏底部的文本



我制作了一个视频,显示当滚动到最后时,键盘会隐藏底部的文本:

https://photos.app.goo.gl/XZRDphEmAh5aR9D78

如果你想查看该应用程序和GitHub项目,并自己使用该应用程序及代码,你会在这里找到:supernote.org

我已经尝试了清单中的各种东西,比如:android:windowSoftInputMode="adjustResize"

这就是xml:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="16dp"
tools:activity=".EditNoteActivity"
android:weightSum="100"
android:id="@+id/linearLayoutEditNoteActivity"
>
<EditText
android:id="@+id/edit_text_title"
android:textSize="25sp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:inputType="text"
tools:ignore="Autofill,LabelFor"
android:layout_weight="90"
android:gravity="top"
/>

<EditText
android:gravity="top"
android:layout_weight="10"
android:id="@+id/edit_text_description"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:inputType="textMultiLine"
tools:ignore="Autofill,LabelFor"
android:background="@null"
/>
</LinearLayout>

将其添加到清单文件中的活动标记中:

android:windowSoftInputMode="adjustResize"

android:windowSoftInputMode="adjustPan"

例如:

<activity android:name=".MainActivity" android:windowSoftInputMode="adjustResize" android:screenOrientation="portrait" >
</activity>

阅读这里的问题和我对这个问题的回答,他也有类似的问题。

更新:

尝试使用ConstraintLayout而不是LinearLayout。。

最新更新