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

来源:互联网 发布:常见的网络攻击类型有 编辑:程序博客网 时间:2024/06/05 06:29

个人感觉和加载很流畅,而且如果和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包下载

1 0
原创粉丝点击