I have an activity with a CollapsingToolbarLayout and a TabLayout. When I slide right and left it moves perfectly between fragments. However when I try to scroll down (red a
Try this layout. I have added TabLayout
in AppBarLayout
, I believe it should work same as you want. But if you want, you can keep two CollapsingToolbarLayout
to achieve your desired behaviour. And make sure fitsSystemWindows
should be same either true
or false
in all layouts else you might not see the expected behaviour.
And in Fragment
layout, Use NestedScrollView
and add layout_behavior
in it.
// Your Layout