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. Ubuntu 12.10 安装VirtualBox增强功能

    原文链接:http://fengbaoxp.iteye.com/blog/1871825 Ubuntu 12.10 Desktop         首先,通过VirtualBox菜单(设备->安 ...

  2. VB6.0中WinSock控件属性和方法详解

    原文链接:http://liweibird.blog.51cto.com/631764/653134 WinSock控件能够通过UDP协议(用户数据报协议)或TCP协议(数据传输协议)连接到远程的机器 ...

  3. FastDFS与springBoot集成

    参考博客http://blog.csdn.net/xyang81/article/details/52850667 tobato在今年9月份在官方Java客户端的基础上进行了大量重构,且提供了更多丰富 ...

  4. 用Kotlin写一个基于Spring Boot的RESTful服务

    Spring太复杂了,配置这个东西简直就是浪费生命.尤其在没有什么并发压力,随便搞一个RESTful服务 让整个业务跑起来先的情况下,更是么有必要纠结在一堆的XML配置上.显然这么想的人是很多的,于是 ...

  5. day19(乱码解决方案)

    乱码的解决方案: 首先需要理解乱码的产生原因:无非就是编码格式的问题 1.服务器到浏览器 字节流传输时 产生乱码的原因: 1.浏览器打开方式不对(打开时 的方式为默认的方式,各个浏览器的方式都不同) ...

  6. Android viewpager + 可缩放的imageview

    http://files.cnblogs.com/files/liaolandemengxiang/PhotoWallFallsDemo.rar http://files.cnblogs.com/fi ...

  7. mysql_事务

    事务是针对数据的,不是针对结构的 存储引擎innodb支持事务,myisam不支持事务需求:有一张银行账户表,有A用户给B账户转账,A账户减少,B账户增加,但是A操作之后断电. 解决方案:A减少钱,但 ...

  8. hdu 3910 Liang Guo Sha

    题目链接:hdu 3910 Liang Guo Sha 题目大意:Alice和Bob这两个小伙伴又发明了一种新游戏, 叫两国杀, 每个人手上有两张牌,“杀” 和“闪”, 然后有三个数值A,B和C, 当 ...

  9. vs2017常用快捷键

    项目相关的快捷键 Ctrl + Shift + B = 生成项目 Ctrl + Alt + L = 显示 Solution Explorer(解决方案资源管理器) Ctrl + Shift + A = ...

  10. CopyOnWriteArraySet源码解析

    此文已由作者赵计刚授权网易云社区发布. 欢迎访问网易云社区,了解更多网易技术产品运营经验. 注:在看这篇文章之前,如果对CopyOnWriteArrayList底层不清楚的话,建议先去看看CopyOn ...