我的代码是这样广东话设置线性布局背景从路径
ll.setBackground(Drawable.createFromPath(new ImageLoader().fullPath+"/desiredFilename.png"));
LL是我的线性布局的对象,这是正确的方法
Bitmap bitmap = BitmapFactory.decodeFile(new ImageLoader().fullPath+"/desiredFilename.png");
\t \t Resources res=getResources();
\t \t BitmapDrawable bitmapDrawable = new BitmapDrawable(res,bitmap);
\t \t ll.setBackground(bitmapDrawable);
我也用这个代码,但dosent工作 显示错误noSuchMethods
[http://stackoverflow.com/questions/12781501/android-设置linearlayout背景编程](http://stackoverflow.com/questions/12781501/android-setting-linearlayout-background-programmatically) – 2014-12-08 07:00:43