Add app bar scrolling view behavior to multiple views in CoordinatorLayout

前端 未结 5 1094
死守一世寂寞
死守一世寂寞 2020-12-12 09:41

I am looking to add scroll support to more than just a single, scrollable, child view of CoordinatorLayout in conjunction with an AppBarLayout and

5条回答
  •  我在风中等你
    2020-12-12 10:02

    This is a sticky header put in the middle between Toolbar and RecyclerView:

    To avoid overlaping with the Toolbar you can set different heights to AppBarLayout and CollapsingToolbarLayout:

    
    
    
    
        
    
            
    
            
        
    
    
    
    
    
    
    

    Video demo:

    Also, you can set a height to the Toolbarbut will need to make a custom title with a custom behaviour like this proyect CoordinatorLayoutExample. I made it with a custom title without behavior:

    
    
    
    
        
    
            
    
            
                
            
        
    
    
    
    
    
    
    

    Styles:

    
    

    Video demo:

提交回复
热议问题