JSOUP 使用 URL 在图像视图中显示图像

发布于 2024-12-20 16:25:54 字数 88 浏览 3 评论 0原文

我如何使用 JSOUP 使用 URL 在图像视图中显示图像。任何示例代码都可用。我搜索过但没有找到。

请帮我提供任何链接。

谢谢。

How can i use JSOUP to display images in Image view using the URL. Any sample code is available for that. I searched but i couldn't find out.

Please help me with any link.

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

不醒的梦 2024-12-27 16:25:54

首先与提供的链接建立连接,然后您可以获取图像

imagesRec = document.select("img[src~=(?i)\\.(png|jpe?g|gif)]");

,然后

String imgSrcUrl = img.attr("abs:src"); // imagePath

您将使用 Picasso 库将 url 显示为 imageView 中的图像

Picasso.with(MainActivity.this).load(imgSrcUrl).into(logo);

,就是这样

fir make the connection with provided link then you can get the image with

imagesRec = document.select("img[src~=(?i)\\.(png|jpe?g|gif)]");

then

String imgSrcUrl = img.attr("abs:src"); // imagePath

the you will use the Picasso lib for displaying the url as image in imageView

Picasso.with(MainActivity.this).load(imgSrcUrl).into(logo);

and thats it

骑趴 2024-12-27 16:25:54

您必须从标签中解析图像的 url,然后将其放入字符串或类似的字符串中。然后您可以使用该字符串将图像加载到 imageView 中。

you would have to parse the url of the image from the tag and then put into a string or similar. this string you can then use to load your image into an imageView.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文