正文  基础知识 > 程序示例 >

selector:选中、按下效果

<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.androi...

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@drawable/btn_pressed" android:state_pressed="true"/>
    <item android:drawable="@drawable/btn_pressed" android:state_selected="true"/>
    <item android:drawable="@drawable/btn"/>
</selector>