0

I have made a list which item has checkbox. I hide and show it with android:animateLayoutChanges effect. Now problem is, when list is large, and i set visibility to visible of the checkboxes , only items which are currently in view shows checkbox fine. But when i scroll the list , the items which were off screeb priviously will animate now to show the checkbox.

Similar happens when i set visibility to gone.

1 Answers1

1

Listviews automatically recycle the views for each row, so the view for each row that appears was previously used elsewhere in the list, and changes you have made need to be overridden. You'll have to set the checkbox visibility manually in the getView method.

This post has a great explanation of how listview recycling works, and how you can avoid this issue.

How ListView's recycling mechanism works

Community
  • 1
  • 1
TheoKanning
  • 1,631
  • 11
  • 20