我尝试在Android Studio上创建按钮选择器时收到错误。
编译器在此行<item android:drawable="@drawable/button_design"
这里是button_selector.xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/button_design"
android:state_pressed="true"
/>
</selector>
这里是button_design.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<gradient
android:startColor="#29B6F6"
android:endColor="#0288D1"
android:angle="90"
android:type="linear"
/>
<corners
android:radius="5dp"
/>
<stroke
android:color="#FFFFFF"
android:width="3dp"
/>
</shape>
答案 0 :(得分:0)