Scroll RecyclerView up accordingly when keyboard opens

后端 未结 7 1860
情歌与酒
情歌与酒 2021-01-12 15:34

I have created a chat activity and like facebook messenger, there is an EditText at the bottom and above is the RecyclerView of messages. When Keyboard opens, I want to scro

7条回答
  •  星月不相逢
    2021-01-12 16:14

    I had the same problem and I don't want to set windowSoftInputMode to "adjustResize". The above anwsers do not work for me.

    editText.clearFocused();
    hideKeyboard();
    
    // update your adapter ... 
    
    parent.requestLayout();
    

    Reset the focus of the parent layout and the recylerView will be updated correctlly.

提交回复
热议问题