一、加入依赖关系
在 build.gradle 的配置文件中的 dependencies 节点中加入 glide 的依赖关系,如:
implementation 'com.github.bumptech.glide:glide:3.7.0'
二、开始使用
(一)获取 ImageView 对象的实例
ImageView iv = (ImageView)findViewById(imageViewId);
(二)将图像灌入控件中用于显示
Glide.with(this).load(uri).into(iv);
this 为使用时当前的 acivity。
uri 为图片的网络地址。
iv 为前面获取的 ImageView 控件对象的实例。