2017-03-09 49 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);

改爲:)