If you want a view on top of the TAB, you can swipe up, and you can swipe left or right on the bottom of the TAB to switch pages

Following the demo, the top TAB can normally slide up, the bottom TAB can slide left or right, but the bottom TAB can not slide up or down

Depressed I

First of all, list the articles that I referred to. One article learned to Coordinatorlayout+AppbarLayout

I feel like blog code ah, why can’t slide ah

Also referred to an article CoordinatorLayout+ViewPager+RecyclerView+ custom TabLayout layout

The code is also ok, why can’t slide

My solution: First reference to the existing code in the project, TabLayout +ViewPager annotation, and then changed to RecyclerView, found that still can not, RecyclerView can not slide up and down, suddenly thought, is it because I did not bind adapter RecyclerView ah, Then I bound an Adapter and found that I could slide up and down normally. I was excited and happy

So I think, viewPager can not slide up and down, is it related to my viewPager inside RecyclerView there is no adapter ah, quickly add a adapter to try, sure enough,

It seems that following the online demo to knock code, not say step by step have the effect, maybe all need to be completed to have the effect

Spent nearly a afternoon to walk a pit, hereby record it, if you want to have RecyclerView do demo use, remember to bind adapter