在毕加索加载图片后无法隐藏进度条?

时间:2013-08-28 19:34:44

标签: android view callback progress-bar picasso

我正在尝试在ma app中集成进度条。但我无法跟踪回调方法。进度条始终显示如何隐藏图像被锁定?

holder.imageView = (ImageView) localView.findViewById(R.id.imageView1);
holder.progressBar = (ProgressBar) localView.findViewWithTag(R.id.progressBar1);

localView.setTag(holder);
url = getItem(paramInt);
Picasso.with(getApplicationContext())
.load(url)
.placeholder(R.drawable.ic_launcher)
.error(R.drawable.ic_launcher)
.fit()
.into(holder.imageView, new Callback() {

    @Override
    public void onSuccess() {
        holder.imageView.setVisibility(View.VISIBLE);
        holder.progressBar.setVisibility(View.INVISIBLE);        
    }

    @Override
    public void onError() {
        holder.progressBar.setVisibility(View.VISIBLE);
        holder.imageView.setVisibility(View.INVISIBLE);
    }
});

2 个答案:

答案 0 :(得分:3)

最后我修复了它。毕加索2.0.0 beta.used官方库中有一个错误

答案 1 :(得分:0)

尝试使用VIEW.GONE代替VIEW.INVISIBLE