Android-ImageLoader的最基础的操作
//以下為一個ImageLoader類,這里需要在配置文件中注冊
package com.example.yuekaodemo_02;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;
import android.app.Application;
public class MyImageLoader extends Application {
?@Override
?public void onCreate() {
??// TODO Auto-generated method stub
??super.onCreate();
??initImageLoader();
?}
?
?public void initImageLoader(){
??//獲得ImageLoader對象
??ImageLoader imageLoader = ImageLoader.getInstance();
??//得到構建對象
??ImageLoaderConfiguration.Builder builder = new ImageLoaderConfiguration.Builder(this);
??//初始化ImageLoader
??imageLoader.init(builder.build());
?}
}
-------------------------------------------------------分割線----------------------------------------------------------------------
//以下為ImageLoader在OnCreate中使用的方法
ImageLoader.getInstance().displayImage(imgPath, img); //參數一:網絡路徑 參數二:加載圖片的控件
//下面給大家兩個ImageLoader的詳細介紹的網站
http://www.open-open.com/lib/view/open1433940304473.html
http://blog.csdn.net/xiaanming/article/details/26810303
轉載于:https://www.cnblogs.com/bwandroid/p/5551036.html
總結
以上是生活随笔為你收集整理的Android-ImageLoader的最基础的操作的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: CentOS 7 安装配置 NFS
- 下一篇: 005_控制器和动作