转于:http://houwanji.blog.163.com/blog/static/16227622009724113953183/
--------------------------------------------------------------------------------------------------------
setBackgroundDrawable()的用法
设置控件的背景图片:如下所示
ImageButton btn = (ImageButton)findViewById(R.id.button2);
Drawable dr = this.getResources().getDrawable(R.drawable.icon); //取得图片资源
btn.setBackgroundDrawable(dr); //设置btn的背景图片