想不出隐藏毕加索加载图像之后的进度? [英] couldnt hide the progressbar after loading image in picasso?
本文介绍了想不出隐藏毕加索加载图像之后的进度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图整合进度条在马app.but我无法跟踪回电method.the进度条一直showing.how隐藏在图像loded?
holder.imageView =(ImageView的)localView.findViewById(R.id.imageView1);
holder.progressBar =(进度)localView.findViewWithTag(R.id.progressBar1);
localView.setTag(保持器);
URL =的getItem(paramInt);
Picasso.with(getApplicationContext())
.load(URL)
.placeholder(R.drawable.ic_launcher)
.error(R.drawable.ic_launcher)
。适合()
。走进(holder.imageView,新的回调(){
@覆盖
公共无效的onSuccess(){
holder.imageView.setVisibility(View.VISIBLE);
holder.progressBar.setVisibility(View.INVISIBLE);
}
@覆盖
公共无效onerror的(){
holder.progressBar.setVisibility(View.VISIBLE);
holder.imageView.setVisibility(View.INVISIBLE);
}
});
解决方案
最后我固定it.there是毕加索2.0.0 beta.used官方库中的缺陷
I was trying to integrate progress bar in ma app.but i couldn't track the call back method.the progress bar always showing.how to hide when image is loded?
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);
}
});
解决方案
Finally i fixed it.there was a bug in a Picasso 2.0.0 beta.used official library
这篇关于想不出隐藏毕加索加载图像之后的进度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文