Glide源码解析

基本使用方法:

Glide.with(this)
     .asDrawable()
     .load("http://i6.topit.me/6/5d/45/1131907198420455d6o.jpg")
     .apply(fitCenterTransform(this))
     .apply(placeholderOf(R.drawable.skyblue_logo_wechatfavorite_checked))
     .into(imageView);

  Glide.with()方法用于创建一个加载图片的实例。with()方法可以接收Context、Activity或者Fragment类型的参数。

  load()方法,这个方法用于指定待加载的图片资源。

  into()方法,让图片显示在ImageView

  placeholder()方法,占位图

源码分析:

  见郭霖的博客:http://blog.csdn.net/guolin_blog/article/details/53939176

posted @ 2017-07-07 15:57  yl007  阅读(285)  评论(0编辑  收藏  举报