gpt4 book ai didi

android - 在 android imageview 中使用 Glide 显示谷歌驱动器图像

转载 作者:行者123 更新时间:2023-12-04 23:52:41 25 4
gpt4 key购买 nike

我的驱动器网址是 -
https://drive.google.com/file/d/0B3DFHb2-MdGYa2NMUkVtVkZ1V1k/view?usp=sharing

我想使用 glide 在 android imageview 中显示它。我尝试了很多方法来展示它。
以下是我要显示的代码 -

Glide.with(getActivity()).load(readExcelFeed.getImage().toString()).into(ivQueImage);

请让我知道其中有什么问题。

最佳答案

通过 Glide 库将图像从 Google 驱动器加载到 ImageView 的步骤

第 1 步:在您的云端硬盘中,您希望在 ImageView 上显示哪个图像。您需要从谷歌驱动器的三个点中获取可共享的链接。像这样“https://drive.google.com/open?id=139jBj_GUfmFi_pZN38SS9RMB5wNXMEy9

第 2 步:然后是显示图像的基本 url。链接是
公共(public)静态字符串 BASE_URL = "https://drive.google.com/uc?id= ";

第 3 步:在第 1 步中,您会看到图像的 id,然后将此 id 添加到基本 URL 中。喜欢这种类型
"https://drive.google.com/uc?id=139jBj_GUfmFi_pZN38SS9RMB5wNXMEy9 "

第 4 步:使用 Glide 库在 ImageView 上显示图像,如下所示:

Glide.with(mContext)                      
.load("https://drive.google.com/uc?id=139jBj_GUfmFi_pZN38SS9RMB5wNXMEy9")
.into(holder.user_image);

现在您可以在 ImageView 上看到您的图像。

关于android - 在 android imageview 中使用 Glide 显示谷歌驱动器图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42453328/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com