是否可以使用 Glide 在同一个适配器上显示 GIF 和 JPG 图像?
Is it possible to show GIF and also JPG image on the same adapter using Glide?
是否可以使用 Glide 在同一个适配器上同时显示 GIF 和 JPG 图片?如果可能的话,那么 Glide 中的代码是什么样子的?
你可以这样做
String str = "image or gif url";
if (str.contains(".gif")){
Glide.with(this)
.asGif()
.load(str)
.into(imgeview);
}else{
Glide
.with(this)
.load(str)
.centerCrop()
.into(myImageView);
}
是否可以使用 Glide 在同一个适配器上同时显示 GIF 和 JPG 图片?如果可能的话,那么 Glide 中的代码是什么样子的?
你可以这样做
String str = "image or gif url";
if (str.contains(".gif")){
Glide.with(this)
.asGif()
.load(str)
.into(imgeview);
}else{
Glide
.with(this)
.load(str)
.centerCrop()
.into(myImageView);
}