2015-01-08 72 views
0

我有一個按鈕,我使用xml作爲此按鈕。選擇器和形狀

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> 

它讀取的背景顏色,但我radius.How可以修復它不讀取邊界?

回答

1

使用此:

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

這是不行的,還是相同的 – Okan

+0

我更新了答案 – kelvincer

+0

沒了,還是同樣的 – Okan