Custom view in ListView disappears while scrolling in Android

Posted by troorl on Stack Overflow See other posts from Stack Overflow or by troorl
Published on 2010-03-20T11:17:36Z Indexed on 2010/03/20 11:21 UTC
Read the original article Hit count: 410

Filed under:
|

Hi.

I wrote a simple custom view for rows in ListView. It works fine, but when I try to scroll the list, I see only white rows without content. And when scrolling is over, rows continue to show again.

This is how I draw a custom view:

 @Override 
 protected void onDraw(Canvas canvas) { 
      if(poster != null) { 
           canvas.drawBitmap(poster, padding, padding, paint); 
      } 
      canvas.drawText(title, 55 + padding, 16 + padding, paint); 
 }

Maybe I missed something?

P.S. This is short screencast (400kb) http://dl.dropbox.com/u/190203/test.mpeg

© Stack Overflow or respective owner

Related posts about android

Related posts about java