显示从 json url 检索到的图像
我有一个像这样的json url...
[{"Image":"http://xyz.com/abc .png", "标题":"示例"},{"图片":"http://xyz.com/def.png ”, "Title":"Sample2"}
]
我想要实现的是从 json url 获取图像并将其显示到列表中。旁边必须有标题。此类对象的数量很多,因此它们必须采用列表形式。我不明白如何开始。任何带有示例代码的建议都会有很大帮助...谢谢...
I have a json url like such...
[{"Image":"http://xyz.com/abc.png",
"Title":"Sample"},{"Image":"http://xyz.com/def.png",
"Title":"Sample2"}
]
What i want to achieve is to get the image from json url and display it into a list. Beside it there must be title. There will be number of such objects so they must be in a list form. I couldnt understand how to get started. Any suggestions with sample code will be of great help... Thanks...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要解析您获得的 json 响应。
从他们那里获取图像url
这些 url 只是
与此 url 建立 http 连接并获取图像的 链接
此连接的响应将以字节为单位发送图像
将其转换为位图或编码图像
则显示记住以队列的形式处理服务器请求
如果存在多个图像的多个 url,
you need to parse the json response you have obtained.
fetch the image url from them
these urls are just the link
establish an http connection to this url and fetch the image
the response of this connection will send image in bytes
convert it to bitmap or encoded image
and display
remember to process server requests in form of queue if there exists many urls fro many images