Fix bottom bar in CoordinatorLayout

后端 未结 8 655
独厮守ぢ
独厮守ぢ 2020-12-23 11:04

I have a CoordinatorLayout which contains AppBarLayout and a FrameLayout which contains fragments.

One of this fragment contai

8条回答
  •  礼貌的吻别
    2020-12-23 11:51

    I faced same problem Here is the way That worked for me

    Remove the AppBarLayout layout_behavior so it fixed on top. Define the FrameLayout layout_behavior as app:layout_behavior="@string/appbar_scrolling_view_behavior" so it adjust FrameLayout below the AppBarLayout. In this way way your content of frame layout will scroll but not toolbar. CoordinatorLayout layout like as follows

    
    
    
        
    
            
    
        
    
    
    
    
    
    
    
    

    This is the XML of the your fragment Layout where your recyclerView scroll without affecting your TabLayout and bottom Linear Layout.

    
    
        
    
        
    
            
        
    
        
            
            
    
            
    
        
    
    
    

    I hope it helps someone thanks

    for more info - Scrolling Behavior for Appbars in Android

提交回复
热议问题