Fix bottom bar in CoordinatorLayout

后端 未结 8 790
独厮守ぢ
独厮守ぢ 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

    The best possible solution will be making this kind of hierarchy

    
        
            
               
               
            
            
            Your layout which will be used to hide the toolbar upon interaction.
            
        
    
     
       Other Widgets needs to be placed at a fixed position.
    
    
    

    Don't forget to add

    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    

    the above line into your include's parent ViewGroup.

    Let's have an example of the approach that I am talking about

    
    
    
        
    
            
    
                
    
                
    
            
    
            
    
        
    
        
    
            
    
            
        
    
        
    
            
    
            
        
    
        
    
            

    So far so good. Let's have a look at the result

提交回复
热议问题