首页 > 解决方案 > Picasso.with() 没有在 android 中检索图像

问题描述

foodImage=(ImageView)getView().findViewById(R.id.imageView2);

String url1="https://d9hyo6bif16lx.cloudfront.net/live/img/production/detail/menu/lunch-dinner_soups-salads_crispy-chicken-salad.jpg";
Picasso.with(getActivity().getApplicationContext()).load(url1).fit().into(foodImage);

我无法检索它给我空白的图像。感谢您的建议。

标签: android

解决方案


将毕加索依赖更新为

implementation 'com.squareup.picasso:picasso:2.71828'

并将代码修改为 -

Picasso.get().load(url1).resize(100,100).centerCrop().into(foodImage);

推荐阅读