ImageLoader的各种格式DisplayImageOptions 的设置

来源:互联网 发布:知党规 行敬畏 编辑:程序博客网 时间:2024/04/30 12:10
  1. DisplayImageOptions options;  
  2. options = new DisplayImageOptions.Builder()  
  3.  .showImageOnLoading(R.drawable.ic_launcher) //设置图片在下载期间显示的图片  

  4.  .showImageForEmptyUri(R.drawable.ic_launcher)//设置图片Uri为空或是错误的时候显示的图片  

  5. .showImageOnFail(R.drawable.ic_launcher)  //设置图片加载/解码过程中错误时候显示的图片

  6. .cacheInMemory(true)//设置下载的图片是否缓存在内存中  

  7. .cacheOnDisc(true)//设置下载的图片是否缓存在SD卡中 
  8.  
  9. .considerExifParams(true)  //是否考虑JPEG图像EXIF参数(旋转,翻转)

  10. .imageScaleType(ImageScaleType.EXACTLY_STRETCHED)//设置图片以如何的编码方式显示  

  11. .bitmapConfig(Bitmap.Config.RGB_565)//设置图片的解码类型//  

  12. .decodingOptions(android.graphics.BitmapFactory.Options decodingOptions)//设置图片的解码配置  

  13. //.delayBeforeLoading(int delayInMillis)//int delayInMillis为你设置的下载前的延迟时间
  14. //设置图片加入缓存前,对bitmap进行设置  
  15. //.preProcessor(BitmapProcessor preProcessor)  
  16. .resetViewBeforeLoading(true)//设置图片在下载前是否重置,复位  

  17. .displayer(new RoundedBitmapDisplayer(20))//是否设置为圆角,弧度为多少  

  18. .displayer(new FadeInBitmapDisplayer(100))//是否图片加载好后渐入的动画时间  

  19. .build();//构建完成  
1 0
原创粉丝点击