关于设置Android Button按钮状态(normal,focused,pressed)图片,有没有简便的方法

Android Button按钮状态(normal,focused,pressed)的图片
大都用drawable "selector" 来实现
类似
btn_background.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_pressed" /> <!-- pressed -->
     <item android:state_focused="true"
           android:drawable="@drawable/btn_normal" /> <!-- focused -->
     <item android:drawable="@drawable/btn_normal" /> <!-- default -->
</selector>
layout.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
<Button  
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:background="@drawable/btn_background"
    />
</LinearLayout>

上面这种做法,意味每一个按钮都要定义它的selector,如果按钮很多,这工作量不说,也太繁琐了,现在就碰到一个项目,里面需要单独定义的按钮非常多。
不知各位大侠,有没有想出方便的方案。多谢了

可以考虑继承Button或ImageButton做个自定义控件,并在自定义控件中加两个自定义状态图片的属性(如android:focusedBackground,android:pressedBackground),然后就可以直接在界面的XML里写这两个属性,如:

    < com.xxx.xxx.MyImageButton android:id="xxx"
  android:layout_width="wrap_content" 
  android:layout_height="wrap_content" 
  android:background="xxx"
  android:focusedBackground="xxx"
  android:pressedBackground="xxx"
/>

关于自定义控件中如何读取自定义属性,网上有现成的例子资料参考,如:
http://www.cnblogs.com/xiaoQLu/archive/2011/07/20/2112004.html

可以给按钮一个OnTouchListener 在其中处理....