iOS自我学习库

collectionview添加表头的方法

2017-06-07  本文已影响33人  BlueBar
给collectionView设置头标题视图:

​UIView *HeaderView = [[UIView alloc]initWithFrame:CGRectMake(0, -313, self.view.width, 313)];    

self.collectionView.contentInset = UIEdgeInsetsMake(313, 0, 0, 0);//上左下右    

​HeaderView.backgroundColor = [UIColor redColor];

 [self.collectionView addSubview:HeaderView];
上一篇 下一篇

猜你喜欢

热点阅读