#android
#Android
Вопрос:
У меня простой макет с двумя TextInputEditText
полями друг под другом в NestedScrollView
:
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">
<com.google.android.material.textfield.TextInputEditText
android:id="@ id/edittext_verses"
android:inputType="textMultiLine"
android:gravity="top|start"
android:minLines="10"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp">
<com.google.android.material.textfield.TextInputEditText
android:id="@ id/edittext_experience"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:minLines="10"
android:gravity="top|start"
android:inputType="textMultiLine" />
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>
Я использую android:windowSoftInputMode="adjustResize"
для соответствующего действия в манифесте.
У меня много текста в первом TextInputEditText
. Когда пользователь хочет отредактировать текст в начале, прикоснувшись к нему, появляется клавиатура, но текстовый вид внезапно выскакивает, и курсор скрывается за верхней частью. Таким образом, пользователь должен редактировать текст «вслепую», потому что курсор исчез.
Есть идеи?
Ответ №1:
По-видимому, это обнаруженная ошибка.
Моим решением было вернуться к обычному EditText
.