使用Glide不加载图像 [英] Image is not loaded using Glide

查看:270
本文介绍了使用Glide不加载图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个矢量图像。如果我想将图像设置为ImageView,则不会加载图片。

I have a vector image. If I want to set the image to ImageView, the picture is not loaded.

代码:

Glide.with(this).load(R.drawable.vector_image).into(imageView)

但是,当我使用时:

imageView.setImageDrawable(ContextCompat.getDrawable(this, R.drawable.vector_image)) 

它正在工作。

有什么想法吗?

推荐答案

Glide还不支持矢量绘图。因此,您必须自己实现矢量绘图。
作为参考,您可以查看开发人员在github上报告的此问题的以下链接:

Glide doesn't support vector drawables yet. So implementing vector drawables you have to do yourself. For reference you can check below links for this issue reported by developers on github:

链接1

链接2

这篇关于使用Glide不加载图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆