我正在尝试关注代码但没有任何作用:
CGRect frame = collectionview.frame;
collectionview.frame = CGRectMake (frame.origin.x, frame.origin.y+100, frame.size, frame.size-100);
项目的AutoLayout设置为true。
答案 0 :(得分:2)
尝试以下代码:
CGRect frame = collectionview.frame;
collectionview.frame = CGRectMake (frame.origin.x, frame.origin.y+100, frame.size.width, frame.size.height-100);
答案 1 :(得分:0)
试试这个:
CGRect frame = collectionview.frame;
frame = CGRectMake (frame.origin.x, frame.origin.y+100, frame.size, frame.size-100);
collectionview.frame=frame;