Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/205.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android ConstraintLayout和RecyclerView_Android_Android Recyclerview_Keyboard_Android Manifest_Android Constraintlayout - Fatal编程技术网

Android ConstraintLayout和RecyclerView

Android ConstraintLayout和RecyclerView,android,android-recyclerview,keyboard,android-manifest,android-constraintlayout,Android,Android Recyclerview,Keyboard,Android Manifest,Android Constraintlayout,我使用的是约束布局,里面有RecyclerView。 无论何时打开键盘,它都会调整窗口的大小,但不会将RecyclerView滚动到正确的项目 我发现的所有其他解决方案都不起作用,或者是自己编写逻辑代码。通常仅使用“始终滚动到底部”,这也是不可接受的 查看hirearchy ConstraintLayout TextView (topToParent) RecyclerView (topToBottomOf TextView, bottomToTopOf EditText)

我使用的是约束布局,里面有RecyclerView。 无论何时打开键盘,它都会调整窗口的大小,但不会将RecyclerView滚动到正确的项目

我发现的所有其他解决方案都不起作用,或者是自己编写逻辑代码。通常仅使用“始终滚动到底部”,这也是不可接受的

查看hirearchy

ConstraintLayout
    TextView (topToParent)
    RecyclerView (topToBottomOf TextView, bottomToTopOf EditText)
    EditText (bottomToParent)
清单

<activity 
    android:name=".ChatActivity"
    android:windowSoftInputMode="adjustResize"
/>

有什么我没有找到的解决办法吗

附言:
adjustPan
起作用,但这并不是我们想要的行为


//编辑:首选非编程解决方案。

如果您的视图仅包含RecyclerView,我建议您添加

    android:windowSoftInputMode="adjustNothing"

到AndroidManifest.xml文件中的活动。当键盘出现时,它会阻止用户界面跳转。

不幸的是,它不是唯一一个。。我的缺点是把问题写得太紧凑,把它改写成相对的布局,这样就可以了。所以,要么我不太了解你,要么这是一个错误。