터치 오버 효과 주기위해서 항상 버튼마다 이미지 두개 넣고 xml 하나 만들었는데요.


이 작업이 너무 노가다라서 너무 불편합니다.


그냥 소스상에서 노멀이미지 id랑 오버이미지 id를 가지고 selector 객체를 만들수는 없을까요?


모든 버튼마다 xml하나씩 만들라니 아주 미치겠습니다.


<?xml version="1.0" encoding="utf-8"?> 

<selector xmlns:android="http://schemas.android.com/apk/res/android"> 

    <item 

    android:state_focused="true" 

    android:state_pressed="true" 

    android:drawable="@drawable/btn_cancel_s" /> 

    <item 

    android:state_focused="true" 

    android:state_pressed="false" 

    android:drawable="@drawable/btn_cancel_s" />    

<item 

    android:state_focused="false" 

    android:state_pressed="true" 

    android:drawable="@drawable/btn_cancel_s" /> 

    <item 

    android:drawable="@drawable/btn_cancel_n" />    

</selector>