-2

I am trying following code but nothing works :

CGRect frame  = collectionview.frame;  
collectionview.frame = CGRectMake (frame.origin.x, frame.origin.y+100, frame.size, frame.size-100);

AutoLayout is set to true for the project.

2 Answers2

2

Try below code:

CGRect frame  = collectionview.frame;  
collectionview.frame = CGRectMake (frame.origin.x, frame.origin.y+100, frame.size.width, frame.size.height-100);
Apurv
  • 17,116
  • 8
  • 51
  • 67
0

Try this one :

CGRect frame = collectionview.frame;
frame = CGRectMake (frame.origin.x, frame.origin.y+100, frame.size, frame.size-100);
collectionview.frame=frame;
Maruti
  • 400
  • 4
  • 14