기본 콘텐츠로 건너뛰기

Android, Button, set TouchDown image, 버튼 ON/OFF 이미지 설정


btn.xml
***************************************************************

<?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/btn_01_on" />
    <item
        android:state_pressed="false"
        android:drawable="@drawable/btn_01_off" />
</selector>

***************************************************************

버튼의 이미지에는 btn.xml을 지정하면 된다.

댓글