Tencent / QMUI_Android

提高 Android UI 开发效率的 UI 库
http://qmuiteam.com/android
Other
14.42k stars 2.67k forks source link

QMUIContinuousNestedScrollLayout键盘问题 #1131

Open victorfan336 opened 2 years ago

victorfan336 commented 2 years ago

运行环境

具体问题描述

参考Demo中QDContinuousNestedScroll6Fragment类,QMUIContinuousNestedScrollLayout中的LinearLayout + recyclerview,实现一个头部+recyclerview滚动的界面效果。 其中xml布局最外层使用的是QMUIWindowInsetLayout2,头部最外层使用的是QMUIContinuousNestedTopLinearLayout,recyclerview使用的是QMUIContinuousNestedBottomRecyclerView。其他代码布局设置参考demo。 进入页面滑动是正常的,但是我的界面中每个item都带有一个EditText,需要输入内容。点击底部的输入框后,要么时输入框被遮挡,要么就是输入法弹出后又自动收起。 然后我在QMUI上修改了QMUIContinuousNestedScrollLayout中的LinearLayout + recyclerview中adapter的布局代码,发现出现了同样的问题。

键盘弹出后自动收起

输入框被遮挡

demo修改的地方: 把QDContinuousNestedScroll6Fragment中的adapter的getItemLayoutId()方法xml布局换成下面这个,效果图如上所示。 布局文件 ` <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" xmlns:app="http://schemas.android.com/apk/res-auto">

<TextView
    android:id="@+id/text_view"
    android:layout_width="100dp"
    android:layout_height="wrap_content"
    app:layout_constraintTop_toTopOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    android:text="34343" />

<EditText
    android:id="@+id/edit_text"
    android:layout_width="200dp"
    android:layout_height="40dp"
    android:hint="@string/app_name"
    app:layout_constraintTop_toTopOf="parent"
    app:layout_constraintStart_toEndOf="@+id/text_view" />

</androidx.constraintlayout.widget.ConstraintLayout> ` 麻烦看下,谢谢。 @hzlzh @MoLice @chanthuang @kayo5994 @1109993488

zhupengxiang commented 1 year ago

@victorfan336 兄弟 请问item里有输入框 键盘遮挡输入框的问题解决了吗