[英]How to set image url to Subsampling-Scale-ImageView?
您好,我想将图像 url(来自 Firebase 存储)设置为Subsampling-Scale-ImageView
。 请帮帮我,这是我的代码
SubsamplingScaleImageView imageView;
imageView = (SubsamplingScaleImageView)findViewById(R.id.my_image_view);
imageView.setImage(ImageSource.uri(missingPerson.getImageUrl()));
Glide.with(this)
.asBitmap()
.load(你的网址)
.error(R.drawable.error)
.diskCacheStrategy(DiskCacheStrategy.ALL)
.into(new CustomTarget() {
@覆盖
public void onResourceReady(@NonNull Bitmap 资源,@Nullable Transition<? super Bitmap> 转换) {
scaleImageView.setImage(ImageSource.bitmap(resource));
scaleImageView.buildDrawingCache();
}
@覆盖
public void onLoadCleared(@Nullable Drawable placeholder) {
}
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.