大家好,我写了下面的selector_button.xml
来让我的按钮在被点击时更加美观。但是它并没有对我的按钮产生影响。我错在哪里了?
这是selector_button.xml
的内容:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<!-- When clicked -->
<item android:state_pressed="true"
android:state_selected="true" >
<shape >
<gradient
android:angle="90"
android:centerColor="@color/Lightgray"
android:endColor="@color/White"
android:startColor="@color/LightBlue"/>
<corners android:radius="12dip" />
<stroke
android:width="0dip"
android:color="@color/LightBlue" />
</shape>
</item>
<!-- When not clicked-->
<item >
<shape >
<gradient
android:angle="90"
android:centerColor="#ff008888"
android:endColor="@color/LightBlue"
android:startColor="@color/Lightgray"/>
<corners android:radius="12dip" />
<stroke
android:width="0dip"
android:color="@color/LightBlue" />
</shape>
</item>
</selector>