【发布时间】:2015-03-04 18:34:16
【问题描述】:
我正在使用 Picasso 和 RoundedTransformation class,它将圆角应用于我使用 Picasso 加载的图像。相关代码如下:
Transformation transformation = new RoundedTransformationBuilder()
.cornerRadiusDp(4)
.oval(false)
.build();
ImageView cardViewTop1Image = (ImageView) cardViewTop1.findViewById(R.id.cv_top1_image);
Picasso.with(cardViewTop1.getContext()).load("http:/some_image_url.com")
.fit().centerCrop()
.transform(transformation).into(cardViewTop1Image);
这一切都很好,直到我经历了两次方向变化——首先是水平方向,然后是垂直方向。当我切换回垂直方向时,不再应用圆角变换。
我相信毕加索正在缓存未转换的图像,然后用它填充 ImageView。有没有办法可以缓存转换后的图像或从缓存中加载未转换的图像然后应用转换?感谢您的帮助!
【问题讨论】:
-
我也看到了类似的问题。已经找到解决这个问题的方法了吗?