How can I add the new “Floating Action Button” between two widgets/layouts

前端 未结 10 2037
离开以前
离开以前 2020-11-22 10:31

I guess you have seen the new Android design guidelines, with the new \"Floating Action Button\" a.k.a \"FAB\"

For instance this pink button:

10条回答
  •  长发绾君心
    2020-11-22 10:34

    Best practice:

    • Add compile 'com.android.support:design:25.0.1' to gradle file
    • Use CoordinatorLayout as root view.
    • Add layout_anchorto the FAB and set it to the top view
    • Add layout_anchorGravity to the FAB and set it to: bottom|right|end

    enter image description here

    
    
        
    
            
    
            
    
        
    
        
    
    
    

提交回复
热议问题