使用 Picasso 加载图像时显示模糊

When load image using Picasso its showing blur

在我的 Android activity 中,我在布局中使用 Picasso 在 ImageView 中加载图像。问题是图像显示为模糊。我已经尝试过另一个像 Glide 这样的图像加载器,但我的图像仍然很模糊。我试过这段代码:

   Picasso.with(this).load(ServiceConstant.BASE_URL_IMAGE + distributor_large_image)
                    .placeholder(R.mipmap.placeholder_banner)
                    .into(img_distributor, new com.squareup.picasso.Callback() {
                        @Override
                        public void onSuccess() {
                            img_distributor.startAnimation(scaleUp);
                        }

                        @Override
                        public void onError() {

                        }
                    });

图像的url是http://tgpsf.progressivecoders.com/resources/images/distributor/thumb/15205922045aa2654c74bd2.jpg

我的布局图像视图是

 <ImageView
            android:id="@+id/img_distributor"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:scaleType="centerCrop"
            android:src="@mipmap/placeholder_banner" />

谁能帮我解决我的问题?

我已经检查了您提供的 URL,这可能是您使用的 small imagelower quality 具有更大图像视图的情况。 所以这可能是问题所在。尝试使用其他 URL 更好的 resolution/quality 进行测试。

您还可以使用 Picasso Lib 的 resize property(以及您想要的参数)。用于快速加载大图像。

嘿,我遇到了同样的问题。 你可以使用这样的东西..

String url = "your url for the image here!!";
Picasso.get()
       .load(url)
       .into(name of the imageview);

这可能对你有帮助..