Add app bar scrolling view behavior to multiple views in CoordinatorLayout

前端 未结 5 1083
死守一世寂寞
死守一世寂寞 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:13

    You don't need a workaround or something strange. This behaviour is supported by the library. Just replace your LinearLayout by this and put it below the RecyclerView:

    
    
        
    
            

    Also you will need to put this in your RecyclerView to show it behind the LinearLayout:

        android:paddingTop="30dp"
        android:clipToPadding="false"
    

    This is how it would look like:

    
    
    
    
        
    
            
    
            
    
        
    
    
    
    
    
    
    
        
    
            

    This is not a nice design, but it is a solution. You can put a nicer Layout inside the LinearLayout to make it like Spotify.

    Edit: Video added

提交回复
热议问题