You can do it by 2 ways:
- Use and
loadImage(...) set layout background in listener ( ImageLoadingListener.onLoadingComplete(..., Bitmap loadedImage, ...) )
- Implement
ImageAware which would wrap LinearLayout (like ImageViewAware ). At this moment you can find ViewAware class in Repository which does the main work for it. You should just extend it like this:
-
public class Bgviewaware extends Viewaware {public bgviewaware (view view) { super view; } Public Bgviewaware (View view, Boolean checkactualviewsize) { super (view, checkactualviewsize); } @Override protected void Setimagedrawableinto (drawable drawable, view view) { view.setbackgrounddrawable ( drawable); } @Override protected void Setimagebitmapinto (Bitmap Bitmap, view view) { view.setbackgrounddrawable (new Bitmapdrawable (View.getresources (), bitmap));} }
And then you can pass the This BgViewAware ( new BgViewAware(linearLayout) ) into displayImage(...) method.
But ViewAware class isn ' t released yet. It'll be available in UIL 1.9.2.
https://github.com/nostra13/Android-Universal-Image-Loader/issues/594
How to set background image to a linearlayout using Android-universal-image-loader? #594