質問

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

他のヒント

Try using VIEW.GONE instead of VIEW.INVISIBLE

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top