解析RecyclerView图像查询 [英] Parse RecyclerView Image Query

查看:154
本文介绍了解析RecyclerView图像查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图将图像加载到从解析Web服务的recyclerview。为此,我需要:

I am attempting to load images into a recyclerview from the Parse web service. For this I will need:

一个。它检索查询,基于标准的,以列表的形式按类别的图像。现在,我已经能够找到方法与ParseObjects要做到这一点,但不是ParseFiles如图片。

A. A query which retrieves, based on criteria, images by category in the form of a List. Now, I have been able to find ways to do this with ParseObjects, but not ParseFiles such as images.

乙。一种从ParseFiles的列表中提取图像,并将它们加载到一个对象,它可以存储这些图像,即使他们没有本地身份证的名单。然后,他们必须被装入recyclerview

B. A way to extract the images from the List of ParseFiles and to load them into a List of an object which can store these images, even though they do not have a local ID. They must then be loaded into the recyclerview.

我很抱歉,我没有更多的信息。解析文档提供很少的相关信息,并有一些我​​已经能够找到任何有用的资源。我不这样做,例如,提供code,因为我的code是一个通用的recyclerview的。我可以张贴在解析文档code,但那是浪费空间。我真诚地道歉,如果这似乎是一个大的请求,它可能是,但我没有发现任何在线帮助,我真的很需要这个。

I am sorry I have no more information. The parse docs provide little relevant information, and there are no helpful resources that I have been able to find. I do not, for example, provide code, because my code is that of a generic recyclerview. I could post code from the parse docs, but that is a waste of space. I apologize sincerely if this may seem like a large request, and it probably is, but I have found no help online and I really need this.

歉意

格芬亚伯拉罕

推荐答案

您可以找到创建的查询中的文件 ParseQuery 类。

You can find a guide of creating queries in the documentation to ParseQuery class.

每个ParseFile有方法的getURL(),它可以让你的网址推到一些图像加载库如毕加索,滑翔或UIL。该库提供下载,展示,光盘上的高速缓存,甚至存储图像的方式。

Each ParseFile has method getUrl() which lets you to push that url to some image loading library such as Picasso, Glide or UIL. This libraries provide the ways to download, display, cache and even store images on the disc.

所以,你可以实现你的任务的方式是构建查询实际的限制,然后调用方法 query.findInBackground()和方法完成()发送接收清单RecyclerView适配器在该方法中 onBindViewHolder()通过图片URL加载到ImageView的中相应ViewHolder

So the way you can implement your task is to construct query with actual constraints, then call the method query.findInBackground() and in the method done() of query callback send received list to RecyclerView adapter in which inside the method onBindViewHolder() pass the image url to load to ImageView in corresponding ViewHolder

这篇关于解析RecyclerView图像查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆