QMUI_Android icon indicating copy to clipboard operation
QMUI_Android copied to clipboard

QMUIContinuousNestedScrollLayout键盘问题

Open victorfan336 opened this issue 3 years ago • 1 comments

运行环境

  • [x] 设备型号:红米10X
  • [x] 设备系统版本:Android 10
  • [x] Gradle 版本:7.0.2
  • [x] QMUI Android 版本:2.0.0-alpha10

具体问题描述

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

键盘弹出后自动收起

输入框被遮挡

demo修改的地方: 把QDContinuousNestedScroll6Fragment中的adapter的getItemLayoutId()方法xml布局换成下面这个,效果图如上所示。 布局文件 `

<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

victorfan336 avatar Jan 07 '22 07:01 victorfan336

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

zhupengxiang avatar Jun 13 '23 11:06 zhupengxiang