Two floating action buttons next to each other

前端 未结 12 1473
谎友^
谎友^ 2020-12-23 09:26

The material design documentation has an example of Google Maps showing two floating action buttons next to one another (actually, one above the other).

12条回答
  •  执念已碎
    2020-12-23 10:10

    I can't believe no one has posted the correct answer.

    Wrap the buttons in a ViewGroup and apply the dodgeInsetEdges layout parameter so that the buttons move up with the bottom sheet. For the above use case, we can use a LinearLayout with the XML attribute app:layout_dodgeInsetEdges="bottom".

    Note that we can apply this to any view in a CoordinatorLayout.

    
    
        
        
    
            
    
            
    
        
    
    
    

提交回复
热议问题