How to make the corners of a button round?

前端 未结 13 928
暖寄归人
暖寄归人 2020-11-22 16:36

I want to make the corners of a button round. Is there an easy way to achieve this in Android?

13条回答
  •  萌比男神i
    2020-11-22 17:27

    Create a xml file in drawable folder like below

    
    
        
         
        
    
    

    Apply this as background to button you want make corners round.

    Or you can use separate radius for every corner like below

    android:bottomRightRadius="10dp"
    android:bottomLeftRadius="10dp"
    android:topLeftRadius="10dp"
    android:topRightRadius="10dp"
    

提交回复
热议问题