Open ilia3546 opened 11 years ago
This happens because you are using an instance variable or property of the class, and each view that goes into the CollapseClick needs to be a separate alloc'd and init'd view.
I'm solve this problem by create multiple copy of view
Hi ilia3546, Can you explain in detail how did you solve this problem... Coz this is driving me crazy... If you share some code that would be helpful.. Thank you.
Especially when i use a tableview, the data source and delegate methods are not being called
-(UIView *)viewForCollapseClickContentViewAtIndex:(int)index
{
UIView *vw;
for (int i=1; i<3; i++)// could be your array
{
vw=[[UIView alloc]initWithFrame:CGRectMake(10, 5, 300, 100)];
vw.backgroundColor=[UIColor blueColor];
}
return vw;
}
If you add one view multiple times, then the view will appear only in the last item Example: -(int)numberOfCellsForCollapseClick {return 3;} -(UIView *)viewForCollapseClickContentViewAtIndex:(int)index {return imageView;} We add one view 3 times, but view will appear only in the last CollapseClickCell