How to use RecyclerView inside NestedScrollView?

前端 未结 24 2436
抹茶落季
抹茶落季 2020-11-22 03:39

How to use RecyclerView inside NestedScrollView? RecyclerView content is not visible after setting adapter.

UPDATE

24条回答
  •  忘了有多久
    2020-11-22 04:21

    I used RecyclerView inside a NestedScrollView and it worked for me. The only gotcha I had to keep in mind was that a NestedScrollView takes only one child view. So in my case I used of LienearLayout viewgroup which was housing my RecyclerView plus a number of other views that I needed.

    I experience one issue putting my RecyclerView inside the NestedScrollView. I realized that scrolling the content of my RecyclerView slacked.

    I later realized that my RecyclerView was receiving the scrolling event and therefore was conflicting with the scrolling behavior of the NestedScrollView.

    So to solve that problem, I had to disable the scroll functionality of my RecyclerView with this method movieListNewRecyclerView.setNestedScrollingEnabled(false);

    You can checkout my Instagram for a short video of what I actually did. This is my instagram handle ofelix03

    Click this image to see what I did

提交回复
热议问题