安卓开源框架universal-image-loader 的使用及一个实例(转载)

安卓开源框架universal-image-loader 的使用及一个实例(转载)

http://www.mincoder.com/article/3800.shtml,下面是一些实例代码

    // 创建默认的ImageLoader配置参数
    ImageLoaderConfiguration configuration = new ImageLoaderConfiguration.Builder(this)  
    .memoryCacheExtraOptions(480, 800) // default = device screen dimensions  
    .discCacheExtraOptions(480, 800, CompressFormat.JPEG, 75, null)  
    .threadPoolSize(3) // default  
    .threadPriority(Thread.NORM_PRIORITY - 1) // default  
    .tasksProcessingOrder(QueueProcessingType.FIFO) // default  
    .denyCacheImageMultipleSizesInMemory()  
    .memoryCache(new LruMemoryCache(2 * 1024 * 1024))  
    .memoryCacheSize(2 * 1024 * 1024)  
    .memoryCacheSizePercentage(13) // default  
    .discCache(new UnlimitedDiscCache(getCacheDir())) // default  
    .discCacheSize(50 * 1024 * 1024)  
    .discCacheFileCount(100)  
    .discCacheFileNameGenerator(new HashCodeFileNameGenerator()) // default  
    .imageDownloader(new BaseImageDownloader(this)) // default  
    .defaultDisplayImageOptions(DisplayImageOptions.createSimple()) // default  
    .writeDebugLogs()  
    .build(); 
    ImageLoader.getInstance().init(configuration);

        options = new DisplayImageOptions.Builder()  
        .showImageForEmptyUri(R.drawable.ic_launcher)  
        .showImageOnFail(R.drawable.ic_launcher)  
        .cacheInMemory(true)  
        .cacheOnDisc(true)  
        .build();
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值