简体   繁体   English

使用Picasso将图像加载到ImageView中

[英]Load Image into ImageView using Picasso

I am trying to load an image which is stored in Firebase Storage into an ImageView in one of my activities. 我正在尝试将存储在Firebase存储中的图像加载到我的一个活动中的ImageView中。

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

The above code calls the club class and gets the imageUrl which is stored in Firebase realtime database. 上面的代码调用了club类并获取了存储在Firebase实时数据库中的imageUrl。 I keep getting an error with the "Picasso.get()" part. 我一直在使用“Picasso.get()”部分出错。 It's saying "cannot resolve method 'get()'". 它说“无法解决方法'get()'”。 Anyone know how to fix this? 有人知道怎么修这个东西吗? Or is there a better way to do this? 或者有更好的方法吗?

It is probably because you haven't included the latest version. 可能是因为您没有包含最新版本。

Put implementation 'com.squareup.picasso:picasso:2.71828' to your module level build.gradle file. implementation 'com.squareup.picasso:picasso:2.71828'放到模块级build.gradle文件中。

Like this: 像这样:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM