Android 如果我打开键盘然后关闭,Recyclerview Horizo​​ntal 不显示

Android Recyclerview Horizontal is not displaying if i open keyboard and closed

我在我的 activity 中使用 recyclerview,首先我使用垂直滚动视图它工作正常,现在我改为水平滚动视图。如果我打开键盘视图正在清除,它在没有打开键盘的情况下工作正常。所以我检查了我的代码,问题出在我的水平滚动视图中。我不知道如何解决这个问题,有人可以帮助我解决这个问题。请在我打开键盘并关闭我的 UI 后找到我的代码和图像附件。

        recyclerView.setHasFixedSize(true);
        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false);
        recyclerView.setLayoutManager(linearLayoutManager);
        addExpenseImageAdapter = new AddExpenseImageAdapter(AddExpenseActivity.this, imageBeanList);
        addExpenseImageAdapter.onImageAddClick(this);
        recyclerView.setAdapter(addExpenseImageAdapter);

你必须在 setAdapter 之后设置 LayoutManager 到 recyclerView 并检查 imageBeanList 的大小。

recyclerview

提供静态高度