在控制器的viewDidLayoutSubviews 方法中实现布局约束
-(void)viewDidLayoutSubviews{
[super viewDidLayoutSubviews];
CGFloat y = 110;
_header.frame = CGRectMake(0, 0, kScreenWidth, y);
_collectionView.frame = CGRectMake(0, y, kScreenWidth, kScreenHeight - y);
}
网友评论