You can do it by 2 ways:

  • use loadImage(...) and set layout background in listener (ImageLoadingListener.onLoadingComplete(..., Bitmap loadedImage, ...))
  • Implement ImageAware which will 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 this BgViewAware (new BgViewAware(linearLayout)) into displayImage(...) method.
    But ViewAware class isn't released yet. It will 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的更多相关文章

  1. 第三篇-以LinearLayout进行Android界面设计

    一.新建一个项目 选择empty activity,此时项目里面没有main.java的文件. 二.手动创建java文件 Project那儿选择android模式,在app/java/com....一 ...

  2. Android LinearLayout的android:layout_weight属性

    本文主要介绍Android LinearLayout的android:layout_weight属性意义 android:layout_weight为大小权重,相当于在页面上显示的百分比,它的计算是根 ...

  3. android学习笔记(8)linearlayout与android:layout_weight学习

    一,linearlayout 线性布局,布局文件里设置多个linearlayout来达到总体线性布局的风格. android:gravity="right"对齐方式,居右对齐,gr ...

  4. LinearLayout属性android:orientation

    Android布局LinearLayout注意设置属性android:orientation属性,否则有的组件可能无法显示. 该属性不设置时默认为horizontal.此时第一个控件的宽度若设置成“f ...

  5. android一个上传图片的样例,包含怎样终止上传过程,假设在上传的时候更新进度条(一)

    先上效果图: Layout为: <? xml version="1.0" encoding="utf-8"?> <LinearLayout x ...

  6. Android 开源项目分类汇总(转)

    Android 开源项目分类汇总(转) ## 第一部分 个性化控件(View)主要介绍那些不错个性化的 View,包括 ListView.ActionBar.Menu.ViewPager.Galler ...

  7. Android 开源项目源码解析(第二期)

    Android 开源项目源码解析(第二期) 阅读目录 android-Ultra-Pull-To-Refresh 源码解析 DynamicLoadApk 源码解析 NineOldAnimations ...

  8. Android Third Party Libraries and SDK's

    http://javatechig.com/Android/android-third-party-libraries-sdks Over past few years, the age of mob ...

  9. Android中的LinearLayout布局

    LinearLayout : 线性布局 在一般情况下,当有很多控件需要在一个界面列出来时,我们就可以使用线性布局(LinearLayout)了,  线性布局是按照垂直方向(vertical)或水平方向 ...

随机推荐

  1. 学以致用一 安装centos7.2虚拟机

    5说来惭愧,也是很久没来博客园了.距离上次写的已经快一年,只能说时间过的真的很快. 而如果这一年一直在坚持认真学习的话,收获肯定很多.然而我确又浪费了很多光阴,不得不恨这人生苦短. 在这一年里,小孩还 ...

  2. Arria10 SDI II学习笔记

    12G-SDI16是什么意思? 关于 int_vpid_byte1 int_vpid_byte2 int_vpid_byte3 int_vpid_byte4 这些参数是不是如果外部数据有就不需要传输, ...

  3. property属性[Python]

    一.property解释 根据文档资料解释: property([fget[, fset[, fdel[, doc]]]]) Return a property attribute for new-s ...

  4. C#-委派和事件

    委派代表一个方法.当不知道后面的方法名称时,可用委派先声明,待使用方法时,再在委派实例化时写入方法名称. 先声明, public delegate int delegateClassName (参数列 ...

  5. (转)EntityFramework.Extensions

    转自:http://www.symbolsource.org/Public/Metadata/NuGet/Project/EntityFramework.Extended/1.0.0.20/Relea ...

  6. MapGIS10.3新功能

    智能的GIS 支持开放的数据集.数据库.等等 T-C-V 软件结构是继局部网软件的 C/S 结构,互联网软件的 B/S 结构发展起来的适合云 计算.云服务的新一代软件三层结构,分别为终端应用层(T 层 ...

  7. HTML5表单新属性

    HTML5表单新属性 autofocus  自动聚焦 <input type="text" autofocus> placeholder占位文本 tel         ...

  8. 杭电2133What day is it

    给你个日期 问是星期几        知道1 1 1是周1就行了 #include <iostream>#include <cstdio>using namespace std ...

  9. html5 实现qq聊天的气泡效果

    教程:http://m.blog.csdn.net/blog/yhc13429826359/38778337 写的很好.自己实现的时候,由于img float:left,会脱离文档流,导致结构混乱. ...

  10. linux查看RAID信息

    linux查看RAID信息 发表于2013 年 12 月 22 日 RAID分为软RAID和硬RAID 软RAID查看 cat /proc/mdstat 硬RAID查看 在启动画面进raid卡查看 I ...