2017-03-09 85 views
2

我使用自定义的ImageView类,使我的图像缩放,它的工作只是绘制精细,但是当我使用它的Glide图书馆我面对的问题Xamarin - 使用AsBitmap()内滑翔Xamarin

我弄清楚为什么这种情况发生导致这个自定义类不处理滑翔类型,这样的解决方案,以将其转换为位图

链接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

使用

Glide.With(上下文).AsBitmap()负载(URL).Into(IMG);

改为:)