问题
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