Android SmartImageView的使用(堪与ImageLoader加载图片媲美)

SmartImageView是Android的一个替代标准ImageView的组件,它支持从URL或联系人通讯录加载图像,并通过缓存提高加载速度。该组件支持异步加载,易于扩展。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

个人感觉和加载很流畅,而且如果和Imageloader一起使用会更流畅,特此感谢作者James Smith

Overview

SmartImageView is a drop-in replacement for Android’s standardImageView which additionally allows images to be loaded from URLs or the user’s contact address book. Images are cached to memory and to disk for super fast loading.

1.概述

SmartImageView 是一个Android替代标准ImageView,可以将图像从url(网络地址)或用户的联系人图片中进行加载。通过将图像缓存在内存和磁盘中来使图片加载更快。

Features

  • Drop-in replacement for ImageView
  • Load images from a URL
  • Load images from the phone’s contact address book
  • Asynchronous loading of images, loading happens outside the UI thread
  • Images are cached to memory and to disk for super fast loading
  • SmartImage class is easily extendable to load from other sources

2.特性:

作为ImageView的替代
可以从一个URL装载图像
可以从手机的联系人通讯录加载图片
异步加载图片,加载在UI线程
图像缓存在内存和磁盘以使其加载更快
SmartImage类很容易从其他来源可扩展加载

3.基本使用方法:

加一个SmartImageView到你Activity的xml布局中:

<com.loopj.android.image.SmartImageView
    android:id="@+id/my_image" />
得到一个参考布局的SmartImageView:

SmartImageView myImage = (SmartImageView) this.findViewById(R.id.my_image);

从一个URL(网络路径)中加载图片:
myImage.setImageUrl("http://www.awesomeimages.com/myawesomeimage.jpg");
④从 手机的联系人通讯录中加载图片

myImage.setImageContact(contactAddressBookId);

4.关于作者:

James Smith, British entrepreneur and developer based in San Francisco.

I'm the co-founder of Bugsnag with Simon Maynard, and from 2009 to 2012 I led up the product team as CTO of Heyzap.

詹姆斯•史密斯英国企业家和开发人员位于旧金山。
我和西蒙•梅纳德Bugsnag的创始人之一,从2009年到2012年我带领产品团队Heyzap的首席技术官。

5.Jar包下载

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值