且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Android Picasso在加载到imageView之前检查图像URL是否存在

更新时间:2023-11-20 12:03:46

毕加索始终支持占位符和错误图像:

Picasso supports placeholder and error images anyways:

Picasso.get()
    .load(url)
    .placeholder(R.drawable.user_placeholder)
    .error(R.drawable.user_placeholder_error)
    .into(imageView);

因此,如果您要归档的只是显示一些错误图像,则在加载不起作用时,这就是您所需要的.

So, if all you want to archieve, is to show some error image, when loading does not work, that is all you need.