RecyclerView inside ScrollView, some items are not shown

I found the solution myself: replace ScrollView with NestedScrollView and keep recyclerView.setNestedScrollingEnabled(false). I don't know if this is what NestedScrollView is made for but it works.

NOTICE:

  1. NestedScrollView is not a child of ScrollView but of FrameLayout.
  2. This solution will also bring some bugs with self-simulated adjustResize.

In my case, I replaced LineaLayout with RelativeLayout and it's solved the issue and all items have shown.