ImageLoder简单使用

来源:互联网 发布:跑跑卡丁车mac可以玩吗 编辑:程序博客网 时间:2024/06/05 06:24

//定义一个类继承Application并且在清单文件中配置name

public class MyApplocation extends Application {


    @Override
    public void onCreate() {

        super.onCreate();
        //使用默认加载方式
        ImageLoaderConfiguration ilf = ImageLoaderConfiguration
                .createDefault(this);
        ImageLoader il = ImageLoader.getInstance();
        il.init(ilf);

    }

}


        //在适配器getView()方法中给图片赋值时使用

       ImageLoader instance = ImageLoader.getInstance();

        //第一个参数是图片路径,第二个是容器

        instance.displayImage(list.get(position).getImgs(), vh.img);

0 0