Smooth scroll and Fling with NestedScrollView,AppBarLayout and CoordinatorLayout

后端 未结 2 1985
死守一世寂寞
死守一世寂寞 2020-12-31 03:41

I am working on an application where I\'m using AppBarLayout with CollapsingToolbarLayout and NestedScrollView. I have successfully implemented this and it is working fine.<

2条回答
  •  猫巷女王i
    2020-12-31 04:14

    When i was burning my midnight oil this library came like batman

    https://github.com/henrytao-me/smooth-app-bar-layout

    According to which the behavior can be improved by following these steps:

    1.Change

     android.support.design.widget.AppBarLayout
    

    to

     me.henrytao.smoothappbarlayout.SmoothAppBarLayout and set android:id
    

    2.Remove

     app:layout_behavior="@string/appbar_scrolling_view_behavior"
    

    3.Add header to your NestedScrollView or RecyclerView

    Which actually made it to work like charm.

    The final setup looks like

                    
    
                      
    
                        
    
                          
    
                          
                        
                      
    
                      
    
                        
    
                          
                        
                      
                     
    

    If you still face any issue while implementing this ask here i would love to help and mark this up if this answer helps.

提交回复
热议问题