How to make a round button?

user1166635 picture user1166635 · Apr 22, 2012 · Viewed 326.3k times · Source

I'm trying to make a round button, but I don't know how can I do it. I can make button with rounded corners, but how can I can round circle. It's not the same. Please, tell me, is it possible on Android? Thank you.

Answer

Arif Nadeem picture Arif Nadeem · Apr 22, 2012

Create an xml file named roundedbutton.xml in drawable folder

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" 
android:shape="rectangle">
    <solid android:color="#eeffffff" />
    <corners android:bottomRightRadius="8dp"
        android:bottomLeftRadius="8dp"  
        android:topRightRadius="8dp"
        android:topLeftRadius="8dp"/>
</shape>

Finally set that as background to your Button as android:background = "@drawable/roundedbutton"

If you want to make it completely rounded, alter the radius and settle for something that is ok for you.