嘿,我正在使用 glide 进行图像下载, ImageView 中显示的图像正在被拉伸(stretch)(垂直),经过几次搜索后我发现你需要将比例类型定义为 fitXY,我做到了,但那也是似乎不起作用。
Glide.with(getContext()).load(imageUrl +".png")
.fitCenter()
.listener(new RequestListener<String, GlideDrawable>() {
@Override
public boolean onException(Exception e,
String model,
Target<GlideDrawable> target,
boolean isFirstResource)
{
return false;
}
@Override
public boolean onResourceReady(GlideDrawable resource,
String model,
Target<GlideDrawable> target,
boolean isFromMemoryCache,
boolean isFirstResource)
{
icon.setVisibility(View.VISIBLE);
}
}).into(icon);
有人知道我做错了什么吗??
最佳答案
经过几个小时的搜索,我得到了这个解决方案。
Glide.with(getApplicationContext()).load(user_image).apply(new RequestOptions().override(100, 100)).into(ImageView);
关于java - 滑动图像拉伸(stretch),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35747549/