0

I have a button.I am using xml for this button.

Xml:

<?xml version="1.0" encoding="utf-8"?> 
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_pressed="true"
        android:drawable="@color/shareButtonBgClickedColor" />

    <item android:drawable="@color/shareButtonBgColor" >
        <shape>
            <corners
                android:bottomLeftRadius="13dp"
                android:bottomRightRadius="13dp"
                android:topLeftRadius="13dp"
                android:topRightRadius="13dp" />    
        </shape>
    </item>
</selector>

It reads background color but doesn't read border radius.How can I fix it ?

vilpe89
  • 4,656
  • 1
  • 29
  • 36
Okan
  • 1,379
  • 3
  • 25
  • 38

1 Answers1

1

Use this:

<shape xmlns:android="http://schemas.android.com/apk/res/android" 
     android:shape="rectangle">
    <corners
      android:radius="14dp"
    />
</shape>
kelvincer
  • 5,929
  • 6
  • 27
  • 32
  • check this: http://stackoverflow.com/questions/4153517/how-exactly-does-the-androidonclick-xml-attribute-differ-from-setonclicklistene – kelvincer Jan 08 '15 at 23:30