![](/img/trans.png)
[英]Load only some images from disk cache using Universal Image Loader
[英]Load Image From Api And Cache It
我正在從api獲取圖像,我創建了一個Gson模型來獲取物品,現在我嘗試以滑行方式加載圖像,但未顯示,圖像響應看起來像這樣
"image":"2017\/Oct\/1507106147_IMG-20171003-WA0003.jpg"
我只是想知道如何緩存圖像,以便可以顯示它並在listview上平滑滾動。
我認為加載圖片不是有效的網址/模型。 如果圖像在服務器上,則必須確保獲得正確的URL來訪問它,如下所示:
"image":"https://www.blog.google/static/blog/images/google-200x200.7714256da16f.png"
或者也許只是其中的一部分,但是您仍然需要使其成為完整鏈接,以便可以像下面這樣訪問它:
"image":"/images/google-200x200.7714256da16f.png"
String base_url = "https://www.blog.google/static/blog/";
String full_url = base_url + image;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.