在我的安卓活动中,我在布局中使用毕加索在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() {
}
});
并且图像的网址是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 image
或lower quality
更大的图像视图。所以这可能是问题所在。尝试使用分辨率/质量更好的其他图像 URL 进行测试。
您还可以使用毕加索图书馆的resize property
(以及所需的参数(快速加载大图像。
我遇到了同样的问题。你可以使用这样的东西..
String url = "your url for the image here!!";
Picasso.get()
.load(url)
.into(name of the imageview);
这可能会对您有所帮助..