Android Toolbar + Tab Layout + Drawer, Hide toolbar when scrolling and take TabLayout to the top

后端 未结 10 939
遇见更好的自我
遇见更好的自我 2020-12-28 14:41

I have activity which has drawer attached to it. Each menu of the drawer is a fragment, and under one of the menu I have a fragment with TabLayout, and each tab

10条回答
  •  -上瘾入骨i
    2020-12-28 15:17

    I had the same architecture in my application, this how i make it :

    
    
    
    
    
    
    
    
    
    
    
    

    The ViewPager used for the tabs and NestedScrollView used as FrameLayout for the other fragment, i show the ViewPager for the fragments that needs tabs and i hide the NestedScrollView in the other case.

    You can find the behavior here for the NestedScrollView FixedScrollingViewBehavior

提交回复
热议问题