【问题标题】:Loading image using Picasso showing colors in corners使用毕加索加载图像,在角落显示颜色
【发布时间】:2016-03-04 02:56:56
【问题描述】:

我使用Picasso 库在我的应用程序中加载图像。但在某些图像中,它显示了一个彩色角落。请参见附图中的红色。有谁知道为什么会这样?这个怎么解决?

代码:

Picasso picasso = Picasso.with(getActivity());
        picasso.setDebugging(true);
        picasso.load(downloadPath+imgDetailPhoto)
                .placeholder(R.drawable.no_image)
                .error(R.drawable.no_image)
                .into(eventImage, new Callback() {
                    @Override
                    public void onSuccess() {

                    }

                    @Override
                    public void onError() {
                        Log.d("Error...", "picasso load error");
                        Picasso.with(getActivity()).load(R.drawable.no_image).into(eventImage);
                    }
                });

【问题讨论】:

  • 你的代码在哪里?
  • 请查看更新后的问题
  • 设置 picasso.setIndicatorsEnabled(false);在你的毕加索对象中

标签: java android picasso image-loading


【解决方案1】:

在你的毕加索对象中设置picasso.setIndicatorsEnabled(false);

红色颜色表示图片是从网络获取的。

绿色颜色表示图像是从缓存内存中获取的。

蓝色颜色表示图像是从磁盘内存获取的。

picasso.setDebugging(true);弃用

使用picasso.setLoggingEnabled(true);

【讨论】:

  • +!以获得详细的答案。这解决了我的问题 :) 非常感谢 :)
【解决方案2】:

你必须通过调用picasso.setIndicatorsEnabled(false)方法来禁用指标

功能区的意思是显示图像源。希望对你有帮助

检查这个link,在Debug Indicators他们已经清楚地提到它

【讨论】:

  • 感谢您的回答:)
  • 黑白调试模式和指标没有关系。仅当您将 setIndicatorsEnabled(true) 设置为不处于调试模式时,指标才有效。检查毕加索 2.5.2。
【解决方案3】:

这是 picasso 显示的调试指示器,用于指示图像是来自网络、磁盘还是内存。你可以在这里http://square.github.io/picasso/'Debug Indicators'下查看它

对于开发,您可以启用指示图像来源的彩色丝带的显示。在 Picasso 实例上调用 setIndicatorsEnabled(true)。

【讨论】:

  • 感谢您的回答:)
猜你喜欢
  • 2014-05-04
  • 1970-01-01
  • 2018-08-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多