tags:

views:

245

answers:

1

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

+1  A: 

Try setting android:cacheColorHint="#00000000" in the XML layout file for the ListView.

Check this- ListView Backgrounds: An Optimization http://developer.android.com/resources/articles/listview-backgrounds.html This can solve your problem.

Udayan