我想在我的应用程序中集成进度条,但我无法追踪回调方法。进度条一直显示着。如何在图片加载时隐藏它?
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);
}
});
android.app.Activity
жҲ–android.app.Fragment
иў«еһғеңҫеӣһ收гҖӮеҰӮжһңжӮЁдҪҝз”ЁжӯӨж–№жі•пјҢејәзғҲе»әи®®жӮЁи°ғз”ЁзӣёйӮ»зҡ„Picasso.cancelRequest(ImageView)
и°ғз”Ёд»ҘйҳІжӯўдёҙж—¶жі„жјҸгҖӮ - shaktiman_droidPicasso.cancelRequest(ImageView)
?这不是由BaseAdapter
上的getView()
手动回收吗? - chip