PopupMenu click causing RecyclerView to scroll

后端 未结 4 1624
温柔的废话
温柔的废话 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:26

    requestRectangleOnScreennot work for me, in my case, requestRectangleOnScreennot called, when show popupMenu. my solution is override requestChildRectangleOnScreen, and reture false, work well.

    public class PopupAncorRecyclerViewPager extends RecyclerView {
            @Override
        public boolean requestChildRectangleOnScreen(View child, Rect rect, boolean immediate) {
            return false;
        }
    }
    

提交回复
热议问题