【发布时间】:2019-06-09 13:42:14
【问题描述】:
ImageView img = findViewById(R.id.img);
int resId = R.drawable.coffee;
Picasso.get().load(resId).into(img);
为什么它不起作用。但以下工作正常:
ImageView img = findViewById(R.id.img);
String path= "https://images.pexels.com/photos/434213/pexels-photo-434213.jpeg";
Picasso.get().load(path).into(img);
【问题讨论】:
-
不工作?先生什么意思?
-
确保您的可绘制咖啡是有效的。分享日志
-
Picasso.with(<Object of context class>).load(path).into(img); -
只是好奇。为什么你甚至需要 Picasso 将可绘制对象加载到图像视图中? setDrawable() 还不够吗?