How to make Floating Action Button background Gradient?

后端 未结 7 2012
长情又很酷
长情又很酷 2020-12-30 12:00

The code for FAB:



        
7条回答
  •  醉梦人生
    2020-12-30 12:26

    Step 1. Create a new drawable.xml and add this code to it

     
        
    
    
            
                
                    
                
    
            
            
                
    
            
    
        
    

    Step 2.) Now in your dimens.xml add this line of code,

    56dp 
    

    Step 3.) Finally set this drawable.xml in FAB using *android:src="@drawable/drawable.xml"*

    P.S. - Make sure your_icon is a PNG, JPEG.

提交回复
热议问题