Whatsapp like Collapsing Toolbar

后端 未结 4 1533
挽巷
挽巷 2020-11-28 06:33

In my app, I would like to implement Whatsapp home page like collapsible toolbar. That is, while scrolling down the list, the toolbar should go up and the tabs should pin at

4条回答
  •  佛祖请我去吃肉
    2020-11-28 06:42

    Ok, so in order to pass the scrolling event of your listview/recyclerview to the appbarlayout, you need to put the below flag in your framelayout/relativelayout/linearlayout containing your scrolling view, i.e listview/recyclerview :

    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    

    for example, in your case it should be like:

    
      
                             
                
                
                    ..........
                
            
        
    
    
        
    
         // Frame containing your listview/recyclerview/ scrollingview
    
        
    
    
    
    

提交回复
热议问题