Imageloader 最簡單的螢幕適配
阿新 • • 發佈:2018-12-17
public class Lmageloader extends Application {
public static Lmageloader min; @Override public void onCreate() { super.onCreate(); min=this; DisplayImageOptions options=null; options=new DisplayImageOptions.Builder() .showImageOnLoading(R.mipmap.ic_launcher) .showImageForEmptyUri(R.mipmap.ic_launcher) .showImageOnFail(R.mipmap.ic_launcher) .cacheInMemory(true) .cacheOnDisc(true) .build(); ImageLoaderConfiguration config=new ImageLoaderConfiguration.Builder(this) .memoryCacheExtraOptions(480,800) .diskCacheSize(50*1024*1024) .defaultDisplayImageOptions(options) .build(); ImageLoader.getInstance().init(config); }
}