Okan
Okan

Reputation: 1389

Selector and shape

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 ?

Upvotes: 0

Views: 74

Answers (1)

kelvincer
kelvincer

Reputation: 6138

Use this:

<shape xmlns:android="http://schemas.android.com/apk/res/android" 
     android:shape="rectangle">
    <corners
      android:radius="14dp"
    />
</shape>

Upvotes: 1

Related Questions