I have a vector image. If I want to set the image to ImageView, the picture is not loaded.
code:
Glide.with(this).load(R.drawable.vector_image).into(imageView)
However, when I use:
imageView.setImageDrawable(ContextCompat.getDrawable(this, R.drawable.vector_image))
and it is working.
Any ideas?
You can use like this.
Glide.with(this)
.load("")
.placeholder(R.drawable.vector_image)
.into(imageView);
EDIT
You can also use it like this as mentioned on issue
Glide.with(mContext) .load("") .error(R.drawable.vector_image) .into(imageView);
Try this this working fine.
Glide.with(GlideActivity.this).load(R.drawable.ic_launcher)
.fitCenter().into(imageview);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.