To Create Round/Oval(customized) shaped buttons in Android Application

To create round/oval shaped on customized buttons , you need to create a .xml file in drawable folder.

Navigate to drawalble>new>drawable resource file

set the name of file and add this in the file

<item android:state_pressed="false">
       <shape android:shape="oval">
           <solid android:color="#fa09ad"/>
   <item android:state_pressed="true">
       <shape android:shape="oval">
           <solid android:color="#c20586"/>

here when user will press the button its color will change.

now create a simple button in your activity_main.xml file


       android:text="hello" />

and set the back ground as shown for button.

you can configure the shape and size according to you. If you have any query related to the post kindly reply in comment sections.





About kaushal97

Android Enthusiast

Leave a Reply

Your email address will not be published. Required fields are marked *