- (UICollectionView *) categoryCollectionView
{
if (! _categoryCollectionView) { // 创建布局
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc]init];
layout.itemSize = CGSizeMake(KItemWidth,KItemHeight);
layout.minimumInteritemSpacing = KSpace;
layout.minimumLineSpacing = KSpace;
layout.headerReferenceSize = CGSizeMake(KScreentW,KProductHeaderCellH); _categoryCollectionView = [[UICollectionView alloc]initWithFrame:self.view.bounds collectionViewLayout:layout];
_categoryCollectionView.dataSource = self;
_categoryCollectionView.delegate = self;
_categoryCollectionView.backgroundColor = [UIColor colorWithRed:234.0/ green:234.0/ blue:234.0/ alpha:]; // 注册
[_categoryCollectionView registerNib:[UINib nibWithNibName:@"GFBCategoryCollectionViewCell" bundle:nil] forCellWithReuseIdentifier:KProductCell];
[_categoryCollectionView registerNib:[UINib nibWithNibName:@"GFBCategoryCollectionReusableView" bundle:nil] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:KProductHeaderCell]; // 设置内边距,添加轮播图
_categoryCollectionView.contentInset = UIEdgeInsetsMake(KBanerH, , , ); }
return _categoryCollectionView;
}

最新文章

  1. SQL Server 2016白皮书
  2. Hadoop学习笔记—11.MapReduce中的排序和分组
  3. 单例模式:Instance
  4. ServiceManager: Permmission failure: android.permission.RECORD_AUDIO
  5. 数据库IO简介
  6. PHP 实现 一致性哈希 算法(转的)
  7. 小心指针被delete两次
  8. HTTP请求头host解析
  9. Colour your Log4Net events in your RichTextBox zz
  10. (一)chrome扩展 - API小记
  11. Flink Program Guide (8) -- Working with State :Fault Tolerance(DataStream API编程指导 -- For Java)
  12. Linux命令对应的全称解释(转)
  13. php连接mysql(linux下)
  14. alpha冲刺1/10
  15. 附近有什么?8款可以查周边的App
  16. TensorFlow 官方文档中文版 --技术文档
  17. #define 和typedef
  18. 音频播放时出现 Uncaught (in promise) DOMException: play() failed because the user didn't interact with the document first. https://goo.gl/xX8pDD
  19. 【洛谷】P1247 取火柴游戏(Nim)
  20. CentOS 7 调整 home分区 扩大 root分区

热门文章

  1. return this链式操作
  2. java程序调用.net接口服务地址的写法
  3. C# 用正则表达式判断字符串是否为纯数字
  4. java多线程基础(二)--java多线程的基本使用
  5. Docker创建Centos踩出来的坑
  6. FFmpeg编译i386 OSX 脚本
  7. HTML <pre> 标签
  8. 2 cmd中startup显示运行不了显示“不是内部或外部命令”
  9. 给类型为text的input设置value值却无法修改
  10. click事件的累加绑定