在我的xml中,我在NestedRecyclerView中设置了TextInputLayout edittext,当焦点在第一个edittext上时,我将焦点放在第二个edittext上,然后键盘隐藏并显示,在滚动时,键盘隐藏但焦点仍然在那里。任何帮助都将不胜感激。
发布于 2020-10-28 22:45:41
在项目代码中实现OnTouchListener
MyRecycleView.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(v.getWindowToken(), 0);
return false;
}
});这可能对你有帮助,Implementation of RecyclerView that will dismiss keyboard
https://stackoverflow.com/questions/64573868
复制相似问题