Xamarin - 在Glide中使用AsBitmap()

3
我正在使用自定义的ImageView类使我的图片可以缩放,对于drawable,这个方法很有效,但是当我使用Glide库时遇到了问题。
我发现这是因为自定义类无法处理Glide类型,所以解决方案是将其转换为Bitmap。
解决方案链接:Solution
ScaleImageView img = new ScaleImageView(Context);
Glide.With(Context).Load(url).AsBitmap().Into(img);

但是当我实现相同的代码时,我遇到了AsBitmap()的问题,我找不到错误参考。

这是我的错误信息:

 Error CS1061: Type `Com.Bumptech.Glide.DrawableTypeRequest' does not contain a definition for `AsBitmap' and no extension method `AsBitmap' of type `Com.Bumptech.Glide.DrawableTypeRequest' could be found. Are you missing an assembly reference? (CS1061) 
1个回答

1

使用

Glide.With(Context).AsBitmap().Load(url).Into(img);

代替


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接