java - 使用 Picasso 加载图像,在角落显示颜色

标签 java android picasso image-loading

我使用 Picasso用于在我的应用程序中加载图像的库。但在某些图像中,它显示了一个彩色角。请参见附图中的红色。有谁知道为什么会这样?如何解决这个问题? See the red color here

代码:

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 对象中设置 picasso.setIndicatorsEnabled(false);

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

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

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

picasso.setDebugging(true); 已弃用

使用 picasso.setLoggingEnabled(true);

关于java - 使用 Picasso 加载图像,在角落显示颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33999178/

相关文章:

java - JSSC 中的读写超时

java - BIGQUERY - 如何创建与 Pentaho Data Integration (Spoon) 的连接?

android - 如何在android中读取post curl请求并读取响应

android - 从标签栏中删除底线

android - Android Market 搜索引擎是如何工作的?

android - 如何从包含 Android 自动下载图片的 url 中读取图片?

java - 如何访问Fragment类中的setAdapter?

java - 如何估计 JVM 是否有足够的空闲内存用于特定的数据结构?

java - 需要使用Java用逗号和空格分割字符数

android:通过 picasso 从网络加载按钮背景图像