本文介绍了毕加索在上角显示蓝色的红色和绿色的箭头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



这是代码

  ImageUtils.setImageFromUrl(app.selectedRing.getMainPicture(),imageView,MainActivity.this); 


public static void setImageFromUrl(final String url,final ImageView imgView,final Context mContext)
{
Picasso.with(mContext)
.load (url)
.networkPolicy(NetworkPolicy.OFFLINE)
.fit()。centerInside()。placeholder(null)
.into(imgView,new Callback()
{
@Override
public void onSuccess()
{
}

@Override
public void onError()
{
Picasso.with(mContext)
.load(url)
.fit()。centerInside()
.into(imgView,new Callback()
{
@Override
public void onSuccess()
{
}

@Override
public void onError()
{
}
}) ;
}
});
}

我得到的是

问题是左上角的蓝色箭头,有时是红色/绿色。我从来没有见过这样的事情。



发生了什么。

解决方案

p>使用 picasso.setIndicatorsEnabled(false)

  Picasso.with mContext)
.load(url)
.networkPolicy(NetworkPolicy.OFFLINE)
.setIndicatorsEnabled(false)
.fit()。centerInside()。placeholder(null)
.into(imgView,new Callback()
{
@Override
public void onSuccess()
{
}

@覆盖
public void onError()
{
Picasso.with(mContext)
.load(url)
.fit()。centerInside()
.into(imgView,new Callback()
{
@Override
public void onSuccess()
{
}

@Override
public void onError()
{
}
});
}
});

颜色显示正在显示的图像源



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



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



蓝色颜色表示图像是从磁盘存储器


I am using picasso to fire up an image in imageView.

Here is the code

    ImageUtils.setImageFromUrl(app.selectedRing.getMainPicture(), imageView, MainActivity.this);


public static void setImageFromUrl(final String url, final ImageView imgView, final Context mContext)
    {
        Picasso.with(mContext)
                .load(url)
                .networkPolicy(NetworkPolicy.OFFLINE)
                .fit().centerInside().placeholder(null)
                .into(imgView, new Callback()
                {
                    @Override
                    public void onSuccess()
                    {
                    }

                    @Override
                    public void onError()
                    {
                        Picasso.with(mContext)
                                .load(url)
                                .fit().centerInside()
                                .into(imgView, new Callback()
                                {
                                    @Override
                                    public void onSuccess()
                                    {
                                    }

                                    @Override
                                    public void onError()
                                    {
                                    }
                                });
                    }
                });
    }

What i get isThe problem is the blue arrow in left top corner, Sometimes its red/green. I have never seen such a thing before. and its on all the images.

What is going on.

解决方案

Use picasso.setIndicatorsEnabled(false)

Picasso.with(mContext)
                .load(url)
                .networkPolicy(NetworkPolicy.OFFLINE)
                .setIndicatorsEnabled(false)
                .fit().centerInside().placeholder(null)
                .into(imgView, new Callback()
                {
                    @Override
                    public void onSuccess()
                    {
                    }

                    @Override
                    public void onError()
                    {
                        Picasso.with(mContext)
                                .load(url)
                                .fit().centerInside()
                                .into(imgView, new Callback()
                                {
                                    @Override
                                    public void onSuccess()
                                    {
                                    }

                                    @Override
                                    public void onError()
                                    {
                                    }
                                });
                    }
                });

The color shows the source of image which is being displayed

Red color indicates that image is fetched from network.

Green color indicates that image is fetched from cache memory.

Blue color indicates that image is fetched from disk memory.

这篇关于毕加索在上角显示蓝色的红色和绿色的箭头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 14:16