We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Glide最新的4.0 apply(baseOptions)后很多图片不能加载出来,不设置则没有问题,具体代码如下。 public class PostViewHolder extends RecyclerView.ViewHolder { private NineGridImageView mNglContent; private TextView mTvContent; private RequestOptions baseOptions;
private NineGridImageViewAdapter<String> mAdapter = new NineGridImageViewAdapter<String>() { @Override protected void onDisplayImage(Context context, ImageView imageView, String s) { Glide.with(context).load(s).apply(baseOptions).into(imageView);
// Picasso.with(context).load(s).placeholder(R.drawable.ic_default_image).into(imageView); }
@Override protected ImageView generateImageView(Context context) { return super.generateImageView(context); } @Override protected void onItemImageClick(Context context, ImageView imageView, int index, List<String> list) { Toast.makeText(context, "image position is " + index, Toast.LENGTH_SHORT).show(); } }; public PostViewHolder(View itemView) { super(itemView); baseOptions = new RequestOptions() .dontAnimate() .diskCacheStrategy(DiskCacheStrategy.ALL) .centerCrop() .circleCrop() .placeholder(R.drawable.ic_default_image) .error(R.drawable.ic_default_image); mTvContent = (TextView) itemView.findViewById(R.id.tv_content); mNglContent = (NineGridImageView<String>) itemView.findViewById(R.id.ngl_images); mNglContent.setAdapter(mAdapter); mNglContent.setItemImageClickListener(new ItemImageClickListener<String>() { @Override public void onItemImageClick(Context context, ImageView imageView, int index, List<String> list) { Log.d("onItemImageClick", list.get(index)); } }); } public void bind(Post post) { mNglContent.setImagesData(post.getImgUrlList(), post.getmSpanType()); mTvContent.setText(post.getContent()); Log.d("jaeger", "九宫格高度: " + mNglContent.getMeasuredHeight()); Log.d("jaeger", "item 高度: " + itemView.getMeasuredHeight()); } }
The text was updated successfully, but these errors were encountered:
这个可能是 baseOptions 设置了某些选项导致的,你看看 log 里面有什么错误或者 warning
baseOptions
Sorry, something went wrong.
好的,我先看一下
Glide设置了placeholder,滑动后复用的view就显示placeholder图片
No branches or pull requests
Glide最新的4.0 apply(baseOptions)后很多图片不能加载出来,不设置则没有问题,具体代码如下。
public class PostViewHolder extends RecyclerView.ViewHolder {
private NineGridImageView mNglContent;
private TextView mTvContent;
private RequestOptions baseOptions;
// Picasso.with(context).load(s).placeholder(R.drawable.ic_default_image).into(imageView);
}
The text was updated successfully, but these errors were encountered: