此错误发生在 Android 开发中“此项目无法访问,因为前一个项目(项目 #1)比此项目更通用”。
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/button1"></item>
<item android:state_pressed="true"
android:drawable="@drawable/buttonClick"></item>
<item android:state_selected="true" android:drawable="@drawable/buttonSelect"></item>
</selector>
最佳答案
During each state change, the state list is traversed top to bottom and the first item that matches the current state is used—the selection is not based on the "best match," but simply the first item that meets the minimum criteria of the state.
http://developer.android.com/guide/topics/resources/drawable-resource.html
您的第一个项目始终匹配,请将其放在最后
关于android - 此项目无法访问,因为前一个项目(项目 #1)比此项目更通用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17483414/