我在使用 EditText 时遇到问题,因为当我输入的行数超过屏幕上显示的行数时,如果我尝试编辑低于 EditText 可见区域的行,EditText 会隐藏在键盘后面,但如果我编辑其中任何一个那些在可见区域的线,它会适本地调整键盘的 View 。我不明白我在做什么错误?
我使用了 adjustPan 作为 softInputMode。 请观看此视频以更好地理解我想说的话:
编辑文本代码:
<EditText
android:id="@+id/notes_et"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="16dp"
android:ems="10"
android:gravity="top|left"
android:hint="Notes"
android:inputType="textMultiLine"
android:padding="10dp"
android:maxLines="5"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/time_tp"
app:layout_constraintVertical_bias="0.202" />
最佳答案
这可能是因为您将 Activity 全屏显示了。尽量不要全屏显示。
关于android - 隐藏在键盘后面的EditText,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52406068/