android - 使用 Picasso 将图像加载到 ImageView

标签 android firebase firebase-storage picasso

我正在尝试将存储在 Firebase 存储中的图像加载到我的一个 Activity 中的 ImageView 中。

                    String image = club.getImage();
                    Picasso.get().load(image).into(imgView);

上面的代码调用俱乐部类并获取存储在 Firebase 实时数据库中的 imageUrl。 我不断收到“Picasso.get()”部分的错误。 它说“无法解析方法'get()'”。 有人知道怎么修这个东西吗?或者有更好的方法吗?

最佳答案

这可能是因为您没有包含最新版本。

implementation 'com.squareup.picasso:picasso:2.71828' 放入模块级 build.gradle 文件。

像这样:

dependencies { 
    implementation 'com.squareup.picasso:picasso:2.71828'
}

关于android - 使用 Picasso 将图像加载到 ImageView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54505870/

相关文章:

Textview 上的 Android 内存泄漏 - LeakCanary(泄漏可以忽略)

ios - 使用 Firebase 链接 UIProgressView 以显示下载进度

ios - Swift:从共享扩展将文件上传到 Firebase 存储

安卓,Firestore : GlideException: Failed to load resource

java - 如何将数组值随机放入另一个数组?

android - 奥利奥后台服务暂停并自动重新启动

android - 如何从纬度和经度获取当前位置的天气?

android - 将元数据添加到上传的图像 Firebase/Kotlin

firebase - Unity Firebase 加载失败 : "Failed to read Firebase options from the app' s resources. “

node.js - 如何从 firebase 函数中的 "get request"获取参数?