当前位置: 代码迷 >> 综合 >> andorid Selcetor 设置无效
  详细解决方案

andorid Selcetor 设置无效

热度:59   发布时间:2023-12-13 04:09:11.0
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/tickets_for_experience_a_bg" android:state_enabled="false" />
<item android:drawable="@drawable/tickets_for_experience_b_bg" android:state_pressed="false" />
<item android:drawable="@drawable/tickets_for_experience_c_bg" android:state_pressed="true" />
<item android:drawable="@drawable/tickets_for_experience_d_bg" android:state_enabled="true" />

</selector>


注意一定要把android:state_enabled="false"和android:state_pressed="false" 放在前面,否则无效

  相关解决方案