How can I make my button look more like the Floating Action Button from Android JellyBean (v21)?

前端 未结 3 1643
情歌与酒
情歌与酒 2021-02-10 19:25

How do I make my button look more like the Floating Action Button?

My button so far looks close but as yet, doesn\'t look the same. What other changes would you suggest?

3条回答
  •  我寻月下人不归
    2021-02-10 19:54

    I build this kind of button in my app using this code

    Code in Fragment.xml

    Code for drawable (round_button_shape)

    
    
        
            
                
                
                            
            
        
        
            
                
                
                                        
            
        
        
            
                
                
                                        
            
        
         
    
    

    Code for round shape Drawable

    
    
    
        
    
    

    Additionaly i would recommend to use this code within a selector to provide feedback if the user interact with the button

提交回复
热议问题