PopupMenu click causing RecyclerView to scroll

后端 未结 4 1630
温柔的废话
温柔的废话 2021-02-19 16:33

I have an overflow button inside a CardView in Recyclerview. Whenever I am clicking the button,I show a popup menu but also RecyclerView i

4条回答
  •  离开以前
    2021-02-19 17:34

    I have same problem, and I use this way:

    mLayoutManager = new LinearLayoutManager(getContext(), LinearLayoutManager.HORIZONTAL, false) {
                @Override
                public boolean requestChildRectangleOnScreen(RecyclerView parent, View child, Rect rect, boolean immediate) {
                    return false;
                }
            };
    mRecyclerView.setLayoutManager(mLayoutManager);
    

    RecyclerView user layoutmanager to manage layout, so I think change layoutmanger behaver is the bettor solution.

提交回复
热议问题