【发布时间】:2016-02-28 16:09:15
【问题描述】:
在我的应用程序中,我使用了 picasso 库,但是当我集成到我的代码中时,它将以红色显示 .invalidate(file) 。怎么解决?
请找到以下代码以获取更多参考:
FutureCallback<File> writeNewFileCallback = new FutureCallback<File>() {
@Override
public void onCompleted(Exception e, File file) {
if (e == null) { // Success
Picasso.with(MyApp.this.getActivity()).invalidate(file);
Transformation transformation = new RoundedTransformationBuilder()
.scaleType(ImageView.ScaleType.FIT_XY)
.borderColor(Color.parseColor("#77e5e5e5"))
.borderWidthDp(2)
.cornerRadiusDp(15)
.oval(false)
.build();}
什么时候改成:
`Picasso.with(this).invalidate(file);`
“this”将是未知的。
【问题讨论】:
-
用它来使你的图片路径无效:
Picasso.with(getActivity()).invalidate(file);