Stepan
Stepan

Reputation: 1141

Image is not loaded using Glide

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?

Upvotes: 2

Views: 2202

Answers (3)

Rahul Khurana
Rahul Khurana

Reputation: 8834

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);

Upvotes: 1

Sachin Suthar
Sachin Suthar

Reputation: 692

Try this this working fine.

Glide.with(GlideActivity.this).load(R.drawable.ic_launcher)
                    .fitCenter().into(imageview);

Upvotes: 0

Akash Jain
Akash Jain

Reputation: 437

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:

link 1
link 2

Upvotes: 3

Related Questions