Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple view's #12

Open
ilia3546 opened this issue Jul 24, 2013 · 4 comments
Open

Multiple view's #12

ilia3546 opened this issue Jul 24, 2013 · 4 comments

Comments

@ilia3546
Copy link

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

@bennyguitar
Copy link
Owner

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.

@ilia3546
Copy link
Author

I'm solve this problem by create multiple copy of view

@shyamsundar1988
Copy link

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

@VaibhaviOSGeek
Copy link

 -(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;
}

#ilia3546 this might helps you.. I'm not sure..about it :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants