selector设置按钮或者一些点击控件在点击时的效果

时间:2023-07-07 11:11:44
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/ic_toc_white_24dp" android:state_pressed="true"/>
<item android:drawable="@drawable/ic_toc_black_24dp" android:state_focused="false" android:state_pressed="false"/>
<item android:drawable="@drawable/ic_toc_white_24dp" android:state_focused="true"/>
<item android:drawable="@drawable/ic_toc_black_24dp" android:state_focused="false"/> </selector>