记录笔记-关于CollectionView的表头表尾的配置
2016-09-13 13:57
351 查看
bottemLayout = [[UICollectionViewFlowLayout alloc]init]; // 垂直滚动(默认) bottemLayout.scrollDirection = UICollectionViewScrollDirectionVertical; bottemLayout.itemSize = CGSizeMake(DeviceWidth/2,GoodCell_Height); //item的列间距 bottemLayout.minimumInteritemSpacing = 0; //item的行间距 bottemLayout.minimumLineSpacing = 0 ; bottemLayout.sectionInset = UIEdgeInsetsMake(0, 0, 0, 0); // 这两句是必须要的 bottemLayout.headerReferenceSize = CGSizeMake(0,BannerHeight + menuCount_Row * MenuHeight_Row+50 + 50 + MiaoPaiList_Height+MiaoPaiSingle_Height +ThreeHeight_Height +50 + 15); bottemLayout.footerReferenceSize = CGSizeMake(0 , 0); goodsListCollectionView = [[UICollectionView alloc]initWithFrame:CGRectMake(0, 0 , DeviceWidth, DeviceHeight - 64) collectionViewLayout:bottemLayout]; goodsListCollectionView.backgroundColor =[UIColor clearColor]; goodsListCollectionView.delegate =self; goodsListCollectionView.dataSource = self; goodsListCollectionView.showsVerticalScrollIndicator =NO; goodsListCollectionView.showsHorizontalScrollIndicator = NO; [self.view addSubview:goodsListCollectionView]; [goodsListCollectionView registerClass:[UICollectionViewCell class] forCellWithReuseIdentifier:@"goods"]; // 这两句是必须要的 [goodsListCollectionView registerClass:[CustomCollectionHeader class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"myhead"]; // 代理方法进行配置 -(UICollectionReusableView*)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath { CustomCollectionHeader * headerView =[goodsListCollectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"myhead" forIndexPath:indexPath]; headerView.layer.masksToBounds = YES; [headerView initModelWith_height:BannerHeight + menuCount_Row * MenuHeight_Row+50 + 50 + MiaoPaiList_Height+MiaoPaiSingle_Height +ThreeHeight_Height +50 + 15 WithModelDic:nil]; return headerView; }
相关文章推荐
- [转载]关于const用法的 笔记记录
- SSH学习笔记之关于struts-spring-hibernate整合配置问
- iOS学习笔记2—关于tableView的一些简单操作
- 自学笔记:关于 View post()方法的应用
- 关于VIM配置问题工作记录20130524
- freebsd笔记记录三——SSH配置
- 编程问题记录:关于Tomcat配置https/SSL报“No Certificate file specified or invalid file format”的问题
- Spring中关于view层的一些配置和使用方法
- 关于Oracle数据库的用户对象配置以及数据镜像的总结--转载于项目组周朝勇笔记
- cocos2d-x 学习笔记(1)关于cocos2d-x(环境配置,项目结构,文件说明)
- Spring中关于view层的一些配置和使用方法
- 记录IIS7上配置.Net2010的mvc2遇到的jQuery关于ie的Ajax小问题..
- 关于struts2的checkboxlist、select等标签发生could not be resolved as a collection/array/map/enumeration/iterator type异常的记录
- 关于Besizer曲线的几点笔记记录
- 有关于IIS7.5集成模式下的web.config配置问题记录
- Ubuntu 关于DNS Server的安装及配置简单笔记
- spring学习笔记:配置视图解析器ViewResolver
- 关于UIAlertView的笔记
- iphone/ipad关于size, frame and bounds总结和UIScroll view学习笔记
- 关于struts2的checkboxlist、select等标签发生could not be resolved as a collection/array/map/enumeration/iterator type异常的记录