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

前端 未结 10 2225
离开以前
离开以前 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

    here is working code.

    i use appBarLayout to anchor my floatingActionButton. hope this might helpful.

    XML CODE.

    
    
    
        
    
            
    
                
            
        
    
        
    
            
                
    
    
                    
                    
    
    
                    
    
                        
    
                            
    
                                
    
    
                                    
    
    
                                        
    
                                        
    
                                            
    
                                            
    
    
                                        
    
                                        
    
                                        
    
                                            
    
                                            
                                        
    
    
                                        
                                    
    
                                
                            
                        
                    
                
    
            
    
        
    
        
    
    
    

    Now if you paste above code. you will see following result on your device.

提交回复
热议问题