Fragment within CollapsingToolbarLayout with ViewPager won't slide down

后端 未结 1 438
隐瞒了意图╮
隐瞒了意图╮ 2020-12-29 17:23

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

1条回答
  •  隐瞒了意图╮
    2020-12-29 18:05

    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
    
    
    

    0 讨论(0)
提交回复
热议问题