【发布时间】:2013-04-21 11:50:51
【问题描述】:
我需要获取一些 ImageButton 的背景资源,以便稍后重新使用它,设置背景我使用 setBackgroundResource。我没有找到任何获取背景资源的方法。
private void AddImage(int img){
ImageButton imgact1 = (ImageButton)findViewById(R.id.imgact1);
ImageButton imgact2 = (ImageButton)findViewById(R.id.imgact2);
ImageButton imgact3 = (ImageButton)findViewById(R.id.imgact3);
imgact3.setBackgroundResource(img);
}
感谢您的帮助。
【问题讨论】:
标签: java android image background imagebutton