2016-11-25 90 views
0

假設我正在對RecyclerViewRecyclerView現在工作我想在Asynchronously中加載圖片。所以我在Goolge和SO上搜索。我發現this線程。有什麼辦法可以在Xamarin Android中添加Java庫

大約在使用這個線程討論這個 庫

https://github.com/koush/UrlImageViewHelper

但我不知道該如何在我的項目有它的工作添加此。

任何幫助被讚賞和原諒我,如果這是愚蠢的問題。

更新:

現在我已經加入我的項目庫。

並加載圖像I使用以下代碼

string url = Settings.Base_URLs + "User/SetUser/" + item.DoctorId; 
ImageView image = vh.searchimage; 
Koush.UrlImageViewHelper.SetUrlDrawable(image, url); 

但是圖像不顯示。

回答

2

您可以從組件存儲中添加UrlImageViewHelper。右鍵單擊解決方案中的組件文件夾 - >獲取更多組件 - >搜索UrlImageViewHelper - >在搜索框中添加。

另外,如果您需要異步映像下載和緩存,請查看Picasso組件。

Koush.UrlImageViewHelper.SetUrlDrawable (imageView, "http://example.com/image.png", Resource.Drawable.placeholder); 
+0

看到我更新的問題:

如下您可以使用它? – Ironman

+0

@Ironman我已經更新了我的使用答案。要獲得更多幫助,可以查看https://components.xamarin.com/gettingstarted/urlimageviewhelper –

+0

我檢查了一下,但我想從我的服務器上獲取圖像,而不是從Drawable文件夾。 – Ironman

相關問題