使用代码的方式如下:
LinearLayout temp=(LinearLayout)findViewById(R.id.LinearLayout的id); //Drawable d=Drawable.createFromPath(图片路径); //temp.setBackgroundDrawable (d);
temp.setBackgroundResource(d);
使用代码的方式如下:
LinearLayout temp=(LinearLayout)findViewById(R.id.LinearLayout的id); //Drawable d=Drawable.createFromPath(图片路径); //temp.setBackgroundDrawable (d);
temp.setBackgroundResource(d);