0

Possible Duplicate:
How to define a circle shape in an android xml drawable file?

I am using circle drawable in my project.And I am setting the background color from my Populate Circle class.The problem is the circle is not coming perfect round.It is rectangular oval.Please help me with this issue. Here is my drawbale for circle .

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval" >
    <solid android:color="@color/transparent"/>
    <gradient 
        android:angle="270"/>


</shape>

I also tried following drawable .It gives me the perfect round shape but with border when i set the stroke color as transparent or remove it, it again comes in rectangular oval shape. Here is the othe drawable:

<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >

    <item android:state_enabled="true">
        <shape android:shape="oval" >
            <stroke
                android:width="2dp"
                android:color="@color/black" />

            <solid android:color="@color/transparent" />

            <padding
                android:bottom="2dp"
                android:left="10dp"
                android:right="10dp"
                android:top="2dp" />

            <corners
                android:bottomLeftRadius="65dp"
                android:bottomRightRadius="65dp"
                android:topLeftRadius="65dp"
                android:topRightRadius="65dp" />
        </shape>
    </item>

</layer-list>
Community
  • 1
  • 1
ankita
  • 11
  • 1
  • 3

0 Answers0