SmartImageView

SmartImageView是Android ImageView的一个替代实现,支持从URL或联系人地址簿加载图片,并具备内存及磁盘缓存功能,能实现图片的异步加载,大幅提升加载速度。

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

SmartImageView

一:概述(Load Images from URLs or Android Contacts with Caching)

         SmartImageView is a drop-in replacement(替代实现) for Android’s standard ImageView 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.

 

二:Features(特征)

  • Drop-in replacement for ImageView                                                                  ImageView控件的替代实现
  • Load images from a URL                                                                   支持通过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   
  •           SmartImageView类可以被很容易扩展成对其它资源的调用;

 三:Installation & Basic Usage(安装与入门)

       Download the latest .jar file from github and place it in your Android app’s libs/ folder.

        下载最新的.jar文件从github网站并且放置它到你的android app的libs文件夹中

         Add a SmartImageView to your activity’s xml layout:   添加一个SmartImageView到你activity的xml布局文件

               <com.loopj.android.image.SmartImageView
                     android:id="@+id/my_image" />

         Get a reference to the layout’s SmartImageView:

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

         Load an image into the view from a URL:                                                        通过URL来加载图片

           myImage.setImageUrl("http://www.awesomeimages.com/myawesomeimage.jpg");

         Load an image into the view from the phone’s contact address book:             从电话簿中加载图片

           myImage.setImageContact(contactAddressBookId);

 

 四:实例

        商城中展示的主题商品图片就是使用这个开源框架的。

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

GalenFeng

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值