Nested RecyclerView. How to prevent parent RecyclerView from getting scrolled while child RecyclerView is scrolling?

前端 未结 14 1386
余生分开走
余生分开走 2020-12-07 21:24

I am trying to implement a horizontal recyclerview and each item of the recyclerview will be a vertical recyclerview with a grid layou

14条回答
  •  臣服心动
    2020-12-07 21:42

    Use this code to turn off scroll on recyclerview:

    recyclerView.setOnTouchListener(new View.OnTouchListener() {
        @Override
        public boolean onTouch(View v, MotionEvent event) {
            return true;
        }
    });
    

提交回复
热议问题