Overlapping views in coordinatorlayout

后端 未结 2 1041
抹茶落季
抹茶落季 2021-01-04 03:23

The code is below. When fragment loads, it covers the toolbar and my floating action bar. How can I handle this? I want the toolbar to show. It seems there is some overlapp

2条回答
  •  日久生厌
    2021-01-04 03:52

    It is because Inside a coordinator layout you can not set one view in relation to another. You can only have them in relation to the parent. Try with layout below.

    
    
        
    
            
    
            
    
        
    
    
        
    
            

    If you want the bottom linear layout also to not overlap with the fragment then put it inside the relative layout and make sure fragment in above the linear layout.

提交回复
热议问题