Can someone please guide me how exactly can i create a circular buttons and textview in android apps, I am still a new into android development. Please help
-
Have a look at this answer , this question is already asked [link](http://stackoverflow.com/a/3914662/2219600) – amalBit May 13 '13 at 10:34
-
http://stackoverflow.com/questions/9884202/custom-circle-button – Rachel Gallen May 13 '13 at 10:34
-
http://stackoverflow.com/questions/4353740/how-to-make-rounded-textview-in-android – Rachel Gallen May 13 '13 at 10:35
-
Got it programmers.. Thank you :) – Manoj Kumar May 13 '13 at 10:41
2 Answers
You cannot create a real circular view (button or textview) in android - all views are rectangular. That said, you can imitate the look of a circular button by giving it a circular background. There are several ways of doing this. One simple way would be to create a PNG image of a circle, save it in your drawable
folder and then set it as a background for your button:
<Button android:background="@drawable/circle_bg" .../>
Another way would be to use custom shapes to draw a circle:
<shape android:shape="oval" ...>
<solid android:color="#FFFFFF"/>
</shape>
Save that as an XML file in your drawable
as circle.xml
and then reference it in your layout:
<Button android:layout_width="40dp" layout_height="40dp"
android:background="@drawable/circle" ... />
This will create a circular button with 20dp radius.
Of course, you may want to combine this with state selectors to get the highlighted states on touch or focus.
There are loads of examples on the internet. Just search.

- 56,435
- 29
- 168
- 265
As some1 mentioned, to make your custom buttons you've to define Styles: Custom circle button
About TextView: What do you want to do? Change font? Change colour? Change Size?
You've XML attributes for TextViews if you're doing this by XML. Except to change font, that it was implemented in 4.1.
android:text="TextView"
android:textColor="#288BA2"
android:textSize="30sp"