如何解决关闭软输入时滚动未对齐
以下布局错误吗?
在关闭软输入时滚动未对齐。
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
</data>
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#f00"
android:theme="@style/AppTheme.AppBarOverlay"
app:liftOnScroll="true">
<androidx.appcompat.widget.Toolbar
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:popupTheme="@style/AppTheme.PopupOverlay" />
</com.google.android.material.appbar.AppBarLayout>
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="#000"
android:inputType="textMultiLine" />
</androidx.core.widget.NestedScrollView>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</layout>
专注于句子结尾并显示软输入 Focus on end of sentence and display soft input
关闭软输入 Close soft input
滚动没有对齐。 The scroll is out of alignment.
理想情况下,即使关闭软输入,滚动条仍会保留在底部。 Ideally,the scroll remains at the bottom even when the soft input is closed.
甚至在Android OS 5.1中也会发生。
甚至在Android OS 10中也会发生。
出什么问题了?
我有麻烦,因为我无法解决。......
使用ScrollView而不是NestedScrollView,不会发生此问题。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。