ios - Hiding a specific cell hides random cells -


when create uicollectionviewcells, tried in cellforrowatindexpath

(if indexpath.row == 3){     cell.hidden = yes; } 

i have 6 cells. they're randomly set hidden when refresh collectionview. not 1 cell hidden (even though hardcoded 3 make sure @ least 1 cell).

any clue?

its because cell reused.
keep in mind, when use if in cellforrowatindexpath, must implement else part.

if (indexpath.row == 3){     cell.hidden = yes; } else {     cell.hidden = no; } 

or
cell.hidden = indexpath.row == 3;


Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -