Rounded corners on material button

前端 未结 7 720
粉色の甜心
粉色の甜心 2020-12-04 12:26

I\'m following the tips from questions like this to create a button style like suggested on Material Design.

However, I need to change the corner radius and

7条回答
  •  情深已故
    2020-12-04 12:38

    Update:

    Answer by Gabriele Mariotti below is now better.

    Old answer:

    You need to inherit that style.

    Add into your styles.xml:

     
    

    Add file drawable/rounded_shape.xml:

    
    
        
        
    
        
        
    
    
    

    And finally in your layout:

     

    Edit: updated answer to use theme's color rather than hardcoded one.

提交回复
热议问题