创建集合视图
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
layout.itemSize = CGSizeMake(item_W, item_H);
layout.minimumLineSpacing = 15;
layout.minimumInteritemSpacing = item_padding;
layout.sectionInset = UIEdgeInsetsMake(15, 12, 15, 12);//top, left, bottom, right
layout.headerReferenceSize = CGSizeMake(CGRectGetWidth(self.view.frame), 40);
layout.footerReferenceSize = CGSizeMake(CGRectGetWidth(self.view.frame), 10);
self.collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.view.frame), CGRectGetHeight(self.view.frame)) collectionViewLayout:layout];
self.collectionView.delegate = self;
self.collectionView.dataSource = self;
[self.view addSubview:self.collectionView];
self.collectionView.backgroundColor = [UIColor whiteColor];
[self.collectionView registerClass:[GoodsReclassifyCell class] forCellWithReuseIdentifier:GoodsReclassifyCellIdentifier];
[self.collectionView registerClass:[ToolHeaderView class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:ToolHeaderViewIdentifier];
[self.collectionView registerClass:[GoodsReclassFootView class] forSupplementaryViewOfKind:UICollectionElementKindSectionFooter withReuseIdentifier:GoodsReclassFootViewIdentifier];