RecyclerView scrolls to top after keyboard hides

风格不统一 提交于 2019-12-11 09:58:16

问题


I have a recyclerView with height and width matchParent, above and below some views. View below recyclerView is editText. When something is typed in editText and keyboard closes, recyclerView scrolls to top. Any idea why it is happening and how it can be resolved.

Related xml at: https://gist.github.com/anonymous/42c38f8a50daf0f441552c985e29a309


回答1:


You can try to add this code to your manifest:

android:windowSoftInputMode="adjustPan"

<activity
    android:name=".YourActivity"
    android:configChanges="keyboard|keyboardHidden"
    android:label="@string/title_activity"
    android:windowSoftInputMode="adjustPan" 
    >

EDIT



来源:https://stackoverflow.com/questions/45461261/recyclerview-scrolls-to-top-after-keyboard-hides

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!