为什么textvuew设置selector以后只显示press的颜色
1个回答
展开全部
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true"
android:drawable="@drawable/generate_data_btn_press" />
<item android:state_focused="true"
android:drawable="@drawable/generate_data_btn_press" />
<item android:drawable="@drawable/generate_data_btn_normal" />
</selector>
generate_data_btn_text_selector.xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_selected="true" android:color="@android:color/black" />
<item android:state_focused="true"
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true"
android:drawable="@drawable/generate_data_btn_press" />
<item android:state_focused="true"
android:drawable="@drawable/generate_data_btn_press" />
<item android:drawable="@drawable/generate_data_btn_normal" />
</selector>
generate_data_btn_text_selector.xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_selected="true" android:color="@android:color/black" />
<item android:state_focused="true"
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询