iOS 日常开发随笔Swift开发

自定义瀑布流(可添加自定义header和footer)

2017-09-07  本文已影响44人  阿狸先森丶12138

github 地址github.com/Wanghongchao12138/CustomerCollectionView

/* 设置cell 的宽高 */

(CGFloat)collectionView:(UICollectionView)collectionView layout:(WHCWaterfallFlowLayout)collectionViewLayout heightForWidth:(CGFloat)width atIndexPath:(NSIndexPath*)indexPath;

/* 设置collection 的头视图的size */

(CGSize)collectionView:(UICollectionView)collectionView layout:(WHCWaterfallFlowLayout)collectionViewLayout referenceSizeForHeaderInSection:(NSInteger)section;

/* 设置collection footer 视图的size */

(CGSize)collectionView:(UICollectionView)collectionView layout:(WHCWaterfallFlowLayout)collectionViewLayout referenceSizeForFooterInSection:(NSInteger)section;

-- colCount --   设置CollectionView 的cell 的列数   -- sectionInset --    设置cell 的间距

上一篇 下一篇

猜你喜欢

热点阅读