diff --git a/library/src/main/java/com/chad/library/adapter/base/BaseViewHolder.java b/library/src/main/java/com/chad/library/adapter/base/BaseViewHolder.java index 97fe43fec..f461030b4 100755 --- a/library/src/main/java/com/chad/library/adapter/base/BaseViewHolder.java +++ b/library/src/main/java/com/chad/library/adapter/base/BaseViewHolder.java @@ -158,6 +158,12 @@ public BaseViewHolder setImageUrl(int viewId, String imageUrl) { return this; } + public BaseViewHolder setImageUrl(int viewId, String imageUrl, int defResourceId) { + ImageView view = getView(viewId); + Glide.with(context).load(imageUrl).crossFade().placeholder(defResourceId).into(view); + return this; + } + /** * Add an action to set the image of an image view. Can be called multiple times.